Server side function calling

G

Guest

Hi,
Uses: VS.NET 2003, VB.NET, Windows xp

I've written an apsx web page through vb.net. In that I've mentioned a
procedure(Server Side). Now I want to call it through Jscript.

The reason behind is about validations. There are some text to enter in one
text box. So once the user has entered the text, it will check whether the
text is null, if not it will call that server side procedure I've mentioned
in aspx page.

I'm wondering how can I call it. One guy in the news group said to use the
following:

1. __doPostBack(...);
2. document.forms[0].submit();
3. document.getElementById(<Some asp control's client ID>).click();

however it wasn't specific and I didn't understod how to use it. Using codes
to illustrate the solution will be much worthy here.

Thank you,
 
H

Hans Kesting

Hifni said:
Hi,
Uses: VS.NET 2003, VB.NET, Windows xp

I've written an apsx web page through vb.net. In that I've mentioned a
procedure(Server Side). Now I want to call it through Jscript.

The reason behind is about validations. There are some text to enter
in one text box. So once the user has entered the text, it will check
whether the text is null, if not it will call that server side
procedure I've mentioned in aspx page.

I'm wondering how can I call it. One guy in the news group said to
use the following:

1. __doPostBack(...);
2. document.forms[0].submit();
3. document.getElementById(<Some asp control's client ID>).click();

however it wasn't specific and I didn't understod how to use it.
Using codes to illustrate the solution will be much worthy here.

Thank you,

If you want validation, use a CustomValidator. You could provide some
client-side javascript, but that's not required. You are after the server-side
event. There you can do your validation.

Hans Kesting
 
P

Paul Glavich [MVP ASP.NET]

You can use the AJAX.NET libraries to asynchronously do a server side method
call easily through javascript.

Go here http://ajax.schwarz-interactive.de/csharpsample/default.aspx for
examples and downloadable libraries and code.

--
- Paul Glavich
MVP ASP.NET
http://weblogs.asp.net/pglavich
ASPInsiders member - http://www.aspinsiders.com


Hans Kesting said:
Hifni said:
Hi,
Uses: VS.NET 2003, VB.NET, Windows xp

I've written an apsx web page through vb.net. In that I've mentioned a
procedure(Server Side). Now I want to call it through Jscript.

The reason behind is about validations. There are some text to enter
in one text box. So once the user has entered the text, it will check
whether the text is null, if not it will call that server side
procedure I've mentioned in aspx page.

I'm wondering how can I call it. One guy in the news group said to
use the following:

1. __doPostBack(...);
2. document.forms[0].submit();
3. document.getElementById(<Some asp control's client ID>).click();

however it wasn't specific and I didn't understod how to use it.
Using codes to illustrate the solution will be much worthy here.

Thank you,

If you want validation, use a CustomValidator. You could provide some
client-side javascript, but that's not required. You are after the
server-side
event. There you can do your validation.

Hans Kesting
 

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

Top