i believe title says all. how focus on control inside formview within insertitemtemplate within table javascript?
the asp code looks this
<asp:panel ...> <asp:updatepanel ...> <contenttemplate> <asp:sqldatasource ...> <asp:formview id=formview1 ...> <inseritemtemplate> <asp:table id=tblins ...> <asp:textbox id=txtinsmybox ....> </asp:textbox> </asp:table> </inseritemtemplate> <edititemtemplate> <asp:table id=tblupd ...> <asp:textbox id=txtupdmybox ....> </asp:textbox> </asp:table> </edititemtemplate> </asp:formview> <asp:validationsummary /> <div> <asp:button id="btnsave" .../> <asp:button id="btncancel" .../> </div> </contenttemplate> </asp:updatepanel> </asp:panel> and javascript code in header looks this:
<script type="text/javascript"> function regainfocus() { //this works window.parent.document.getelementbyid("btnsave").focus(); //this works window.parent.document.getelementbyid("formview1").focus(); //this not work window.parent.document.getelementbyid('<%#formview1.findcontrol("txtinsmybox").clientid%>').focus(); } </script> i have tried changing tag "#" "=" sign , made not difference. have tried find other different controls inside formview no success.
can shed light on how findcontrol of object inside table inside formview?
Comments
Post a Comment