javascript function call a asp.net sub procedure

S

Steven K

Hello,

Can you call a vb.net procedure inside a JavaScript function? For example I
need to validate 20-30 fields using JavaScript and if everything flies, run
a vb.net procedure:

<script language="JavaScript" type="text/JavaScript">
function frmValidate(theForm)
{
strName = theForm.RequestType;
strValue = strName.value;
if (strValue == "None Selected")
{
alert("Please select the type of request you are submitting in the
\"Request Type\" field.");
strName.focus();
return (false);
}

</script>
 
P

Patrice

The usual way is to submit the form (ie doing a "postback" using .NET
terminology) as the JavaScript is client side while your .NET sub is server
side...

Patrice
 
M

Marina

You can either do a post to a page (same or different).

You could also look into using the Microsoft.XMLHTTP object, which allows
you to programmatically post to a page and pass it parameters - and then get
a result back using javascript.
 
M

Maxim Kazitov

If you want call Server side function from client side JScript you can use
WebServer.htc behavior. If both JScript & .Net code on client side you
should wrap you .Net code into COM.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top