asp.net - un able to get the value of template field text box in a custom method in update event in grid view -


i trying value of txtcustomername textbox (template field) in code behind, when run code,i getting null reference exception

aspx code

                       <asp:templatefield headertext="customer name" >                             <itemtemplate>                                   <asp:label id="lblcusomername" runat="server" text='<%#databinder.eval(container.dataitem, "customername") %>'></asp:label>                             </itemtemplate>                             <edititemtemplate>                                   <asp:textbox id="txtcustomername" runat="server" text='<%#eval("customername")%>'></asp:textbox>                             </edititemtemplate>                         </asp:templatefield> 

       protected void onupdate(object sender, eventargs e)         {             try             {               //  int rowindex = gridviewquotedetails.selectedrow                  string company = ((textbox)gridviewquotedetails.selectedrow.findcontrol("txtcustomername")).text;     } 


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -