Click to See Complete Forum and Search --> : HOW to write Javascript in VB.NET?


NinaWilliam
05-23-2005, 12:35 AM
how can i write if statment in javascript that returns true or false values to vb.net

i mean.. how can i do it to look like the following

javascript code:if (confirm('Are you sure you want to book an appiontment??'))
{return true;

do some VB.NET Code

} else {

return false;

Do some other VB.NET Code

};

Please help...

A1ien51
05-23-2005, 04:29 PM
VB.NET is run on the sever, javascript runs on the client. You can not combine the two.

You are going to have to cause a post back to the server in order to talk with the vb.net code.

Eric

NinaWilliam
05-24-2005, 12:27 AM
and how can i do that?? can you give me an example Please?? :)

PeOfEo
05-24-2005, 09:55 AM
Either use the javascript to modify a query string which the server can read values from or use javascript to modify a form input (hidden) so the server can retrieve the value at post of the form. But the downside of javascript is that it is not going to work for everyone. It will fail for roughly 10% of the internet. So when using javascript keep that in mind and use it for nonessential things or have a backup for those who do not support it.