Search All Articles Submit your Website or Blog to A New Internet Library
Monday, April 20, 2009
How to call Javascript function on onchange event of Dropdownlist before server side event handler is called.
To call Javascript function on onchange event of Dropdownlist before server side event handler for SelectedIdexChanged event is called.
This is some what tricky as mentioning onchange = "return function(this);" in .aspx page will not work properly.
In this case we need to add 'if' codition as below
in .aspx page for dropdown list mention onchange as
onchange = "if (!confirmSubmit()){return};"
or else you can add attributes for dropdownlist as below
Dropdownlist1.Attributes.Add(
"onchange", "if (!confirmSubmit()){return};");
Subscribe to:
Post Comments (Atom)
Also Read other Top Articles
- JSON Serialization in VS 2008
- Implementing Forms Authentication in Silverlight Application.
- Making GridView Rows or Individual Cells Clickable and Selectable.
- Enabling browser back button for GridView Paging and Sorting in Ajax 1.1 and 3.5 (using Visual Studio 2005/ Visual studio 2008)
- How to pass values from User Control to Page or calling Page methods from User Control.
- What is WCF?
- New features in C# 4.0
- C# to VB.NET and VB.NET to C# online free converter tools.


0 comments:
Post a Comment
Post your comments/questions/feedback for this Article.