asp.net - Google Language Dropdown Widget - On Ajax Page -
i have google language drop-down widget on asp.net page. page contains cascading drop-downs. is, on selection of value first drop-down, fill other.
the problem facing is, if select language first google language drop-down , change value first drop-down, values in second drop-down not persisting changed language. sure happening because of async postback. but, if enableajax property false, working. using telerik radajaxmanager implement ajax. please find code attached here
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>test page - asp.net</title> </head> <form id="form1" runat="server"> <asp:scriptmanager runat="server" id="scrpt1"> </asp:scriptmanager> <telerik:radajaxmanager id="radajaxmanager1" runat="server" enableajax="true"> <ajaxsettings> <telerik:ajaxsetting ajaxcontrolid="ddl"> <updatedcontrols> <telerik:ajaxupdatedcontrol controlid="dropdownlist2" /> </updatedcontrols> </telerik:ajaxsetting> </ajaxsettings> </telerik:radajaxmanager> <div> <div id="google_translate_element"> </div> <script type="text/javascript"> function googletranslateelementinit() { new google.translate.translateelement({ pagelanguage: 'en', layout: google.translate.translateelement.inlinelayout.simple}, 'google_translate_element'); } </script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googletranslateelementinit"></script> <br /> <br /> <asp:dropdownlist runat="server" id="ddl" autopostback="true"> <asp:listitem text="a"></asp:listitem> <asp:listitem text="b"></asp:listitem> <asp:listitem text="c"></asp:listitem> <asp:listitem text="d"></asp:listitem> </asp:dropdownlist> <br /> <br /> <asp:dropdownlist runat="server" id="dropdownlist2" /> </div> </form> </html>
code behind
private sub ddl_selectedindexchanged(byval sender object, byval e system.eventargs) handles ddl.selectedindexchanged dropdownlist2.items.add(ddl.selecteditem.text) end sub
please let me know if can achieve ajax enabled.
thanks, srinivas
Comments
Post a Comment