Click here to Skip to main content
16,016,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting this error but I have txtboxname id..So why am i getting the error..?

XML
<InsertParameters>
                <asp:ControlParameter ControlID="txtboxname" Name="Name" Type="String" />



<insertitemtemplate>
XML
<tr>
                       <td>
                           <asp:Label ID="labelname" runat="server" Text="Name:"></asp:Label>
                       </td>
                       <td>
                           <asp:TextBox ID="txtboxname" runat="server" MaxLength="20" Text='<%# Bind("Name") %>'></asp:TextBox>
                       </td>
                   </tr>

Posted

1 solution

controlID value is taken from code behind.

You can try this:


<asp:controlparameter controlid="boxvalue" name="Name" type="String"  />




<tr>
                       <td>
                           <asp:label id="labelname" runat="server" text="Name:"></asp:label>
                       </td>
                       <td>

                           <asp:textbox id="txtboxname" runat="server" maxlength="20" text="<%# Bind("Name") %>" ></asp:textbox>
                       </td>
<asp:hiddenfield runat="server" id="boxvalue"  />
                   </tr>


and in the code side, wherever the binding of the txtboxname takes place, paste this code:

boxvalue.Value = txtboxname.Text

i.e. assign the hiddenfield id the value of the textbox
 
Share this answer
 
v2
Comments
Member 11242836 26-Nov-14 3:51am    
Thank you.!@Divya

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900