Re: Triggering a javascript after postback from dropdownlist
- From: Brock Allen <ballen@xxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Mar 2005 19:24:51 -0800
I think what you really want is Page.RegisterStartupScript. This sets some javascript (or a function you've declared via Page.RegisterScriptBlock) to be called when the window/document loads.
-Brock DevelopMentor http://staff.develop.com/ballen
In my form my users are entering some data, one of them being a dropdownlist. When an item is choosen from that dropdownlist I am posting back to the server in order to retrieve some data from the server that are part of the calculation on the client side.
I am using that javascript code also from other control of my form but WITHOUT postback, in those cases it works fine like this Me.myControlName.Attributes.Add("onchange", "ComputeValue();") The same for the dropdownlist doesn't work well as the postback is doing its job.
On another forum they say I could use a method called RegisterClientScriptBlock; I searched the web for that topic and found a lot of information about this but there is still one thing I am missing: how I am going to say to run this script after coming back from the postback. Most example are showing this method linked with a button or other event manually triggered by a user but I think in my case it is a touch different.
Jean-Luc www.corobori.com
.
- Follow-Ups:
- Re: Triggering a javascript after postback from dropdownlist
- From: Corobori
- Re: Triggering a javascript after postback from dropdownlist
- From: Corobori
- Re: Triggering a javascript after postback from dropdownlist
- References:
- Triggering a javascript after postback from dropdownlist
- From: Corobori
- Triggering a javascript after postback from dropdownlist
- Prev by Date: Separate Project DLLs
- Next by Date: Re: New to Classes, please help.
- Previous by thread: Triggering a javascript after postback from dropdownlist
- Next by thread: Re: Triggering a javascript after postback from dropdownlist
- Index(es):