admin管理员组文章数量:1022944
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
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
本文标签: javascriptDropDownList Clientside onchange stops Serverside SelectedIndexChanged eventStack Overflow
版权声明:本文标题:javascript - DropDownList Client-side onchange stops Server-side SelectedIndexChanged event - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745514989a2153998.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论