How to call the clientside script and server-side script at same time. I cannot able to use both at same time.
<asp:DropDownList ID="ddlModule" runat="server" Width="200px" AutoPostBack="True"
OnSelectedIndexChanged="ddlModule_SelectedIndexChanged" />
In Page_Load
ddlModule.Attributes.Add("onchange", "javascript:return validateDropDown('" + ddlModule.ClientID + "');");
if client script execute then server side not working.
Please Help..
Thanks,
How to call the clientside script and server-side script at same time. I cannot able to use both at same time.
<asp:DropDownList ID="ddlModule" runat="server" Width="200px" AutoPostBack="True"
OnSelectedIndexChanged="ddlModule_SelectedIndexChanged" />
In Page_Load
ddlModule.Attributes.Add("onchange", "javascript:return validateDropDown('" + ddlModule.ClientID + "');");
if client script execute then server side not working.
Please Help..
Thanks,
Share Improve this question edited Jul 5, 2011 at 13:33 Muhammad Akhtar 52.2k37 gold badges139 silver badges191 bronze badges asked May 26, 2011 at 9:05 NavaneethanNavaneethan 2,2456 gold badges24 silver badges32 bronze badges 1- Adding an 'onchange' attribute to a dropdownlist doesn't seem to fire anything in the client side. Did I miss something? – Gezim Commented Jun 5, 2014 at 17:26
1 Answer
Reset to default 3One solution: in your validateDropDown
JavaScript function you can postback the page
<script language='Javascript'>
__doPostBack('__Page', 'MyCustomArgument');
</script>
Here is a reference link How to call Postback from Javascript