ASP.NET + GridView + EmptyDataTemplate -


I have ASP.NET GridView that uses EmptyDataTemplate to use this template to collect data in this event It is done that there is no record in my data source. My GridView source looks like this:

  & lt; Asp: Gridview id = "myGridView" runat = "server" DataKeyNames = "ID" OnRow Edit = "myGridView_RowEditing" OnRowCancelingEdit = "myGridView_RowCancelingEdit" OnRowUpdating = "MyGridView_RowUpdating" ShowFooter = "True" EnableModelValidation = "True" & gt; & Lt; Columns & gt; & Lt; ASP: BoundfieldDefined = "id" visible = "false" /> & Lt; Asp: TemplateField HeaderText = "name" & gt; & Lt; EditItemTemplate & gt; & Lt; ASP: text box id = "textbox" "runty =" server "text = '& lt;% # bind (" name ")% & gt; & Gt; & lt; / asp: Text box & gt; & lt; / EditItemTemplate & gt; & gt; ItemTemplate & gt; & lt; asp: Label ID = "Label1" runat = "server" text = '& lt ;% # Bind ("name")%> & Gt; & lt; / asp: Label & gt; & lt; / ItemTemplate & gt; & gt; FooterTemplate & gt; & lt; asp: text box id = "nameFooterTextBox" runat = "server" / & gt; Lt; / FooterTemplate & gt; & lt; / ASP: TemplateField & gt; asp: TemplateField HeaderText = "Age" & gt; EditItemTemplate & gt; & lt; ASP: Textbox ID = "Textbox2" Runat = "server" text = '& lt;% # bind ("age")% & gt;' / & Gt; & lt; / EditItemTemplate & gt; ItemTemplate & gt; & lt; asp: Label ID = "Label2" runat = "server" text = '& lt;% # bind ("age")% & Gt; & gt; & lt; / ItemTemplate & gt; & gt; FooterTemplate & gt; & lt; ASP: Textbox ID = "Age Text Box" Run = "Server" />   TD> Option & lt; / TD & Gt; & lt; / tr & gt; & lt; tr & gt; & lt; td & gt; & lt; ap: text box id = "name text box" run = "server" /> & lt; / td & Gt; & lt; td & gt; & lt; ASP: Textbox ID = "Agentbox" Runat = "Servers" /> gt; & Lt; / Td> & Lt; Td> & Lt; ASP: LinkButton ID = "Sewellink Button" Runat = "Server" Text = "Save" OnClick = "saveLinkButton_Click" /> gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / EmptyDataTemplate & gt;  

When a user clicks "saveLinkButton" in EmptyDataTemplate, I want to get values ​​from TextBoxes and want to enter a new record in my data source. I am

Thank you !!

This thread has proposed a solution to this problem on ASP.NET (note: I have not used it)

You should handle the roach complaint Need, find the Guardian Naming Container of Control which increases the event (your linkbutton) and then find the text box using FindControl in it.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -