Client side DHTML javascript call webform methods or events

Client side DHTML javascript call webform methods or events

Post by George Padvora » Sun, 19 Aug 2001 17:28:02



I have a webform with frames in it.  I'm trying to make this form look and
work like a fat client data entry form with drop down menus on top and other
features in the other frames.  I've searched high and low for some dotnet
tools or code to create dropdown menus with no luck, so I'm using some dhtml
code I found.  This code uses JavaScript, which I'm totally lame in working
with.

I have 2 questions here:  1) How do I get java script to call a method
behind the webform which would be calling server side methods, and 2) how
would I have the java script call some dotnet generated client side script?
In short, when a dropdown menu item is selected, I will want to call some
code dotnet code.

Thanks.

George Padvorac

 
 
 

Client side DHTML javascript call webform methods or events

Post by Joe Kin » Tue, 21 Aug 2001 06:04:45


George,

Here is an ASP.NET WebControl assembly you can use to create drop down
menus:

http://www.coalesys.com/products/webmenuaspdotnet/default.asp

Regards
--
Joseph King
Coalesys, Inc.
http://www.coalesys.com


> I have a webform with frames in it.  I'm trying to make this form look and
> work like a fat client data entry form with drop down menus on top and
other
> features in the other frames.  I've searched high and low for some dotnet
> tools or code to create dropdown menus with no luck, so I'm using some
dhtml
> code I found.  This code uses JavaScript, which I'm totally lame in
working
> with.

> I have 2 questions here:  1) How do I get java script to call a method
> behind the webform which would be calling server side methods, and 2) how
> would I have the java script call some dotnet generated client side
script?
> In short, when a dropdown menu item is selected, I will want to call some
> code dotnet code.

> Thanks.

> George Padvorac



 
 
 

Client side DHTML javascript call webform methods or events

Post by MS » Sat, 25 Aug 2001 01:20:25



Quote:> I have 2 questions here:  1) How do I get java script to call a method
> behind the webform which would be calling server side methods,

Probably the easiest way to do this is to have a hidden text box that has
the runat=server attribute on the page, and then when the user clicks on the
menu, put the id (or name or whatever) of that menu item into the text box,
and submit the form. You can then do the correct processing on the server
based on the value of your hidden textbox's contents.

Quote:> 2) how
> would I have the java script call some dotnet generated client side
script?
> In short, when a dropdown menu item is selected, I will want to call some
> code dotnet code.

This really requires doing a view-source on the page and getting the
function names, etc. Then you just call them as if they were normal
functions.

Peter

--

Suffering from insomnia? http://www.microsoft.com/info/cpyright.htm
Please post all questions to the group. Thanks.

 
 
 

1. How do I call a server-side click event after client-side Javascript runs?

I have a Web form that I want to runs some checks on using JavaScript and if
the script passes, then I want to call the Click event of the button.

I have tried using the following code:
nextButton.Attributes.Add("onclick", "submitPage();");
nextButton.Click += new EventHandler(nextButton_Click);

This calls the JavaScript function (submitPage), but it calls the Click
event even if the script fails.  Is there a way to call the Server-side
click event from javascript?  Or, is there a way to disable the Click-Event?
I guess an alternative would be to just submit the form using javascript and
handle the post-back in the page load, but I was hoping that there is a more
elegant way to handle this.

2. Beat counter

3. Calling a server side event/method from Javascript

4. Wanted: SCSI controller and RAM!!!!!

5. How do i invoke client side javascript in server side C# method ?

6. Program removal

7. How could I call server-side function from client-side Javascript?

8. Problem with HP5L

9. client side javascript function - called from server side

10. How do call a server side method from a client side script?

11. if a webform control or server control can handle both client-side and server-side events

12. Calling client side script from server side event

13. Breakpoint in Client side javascript in WebForm ASPX