I have 2 textboxes on an Asp.net(with c#) page and I cannot see this fields from cs class.
In aspx:
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<ajaxToolkit:ToolkitScriptManager runat="server"></ajaxToolkit:ToolkitScriptManager>
<div>
<table>
<tr>
<td style="width:40%"> <asp:Label ID="lblFullname" runat="server" Text="Fullname" ></asp:Label></td>
<td style="width:20%"> </td>
<td style="width:40%">
<asp:TextBox ID="txtFullname" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width:40%"> <asp:Label ID="lblBirthDate" runat="server" Text="BirthDate" ></asp:Label></td>
<td style="width:20%"> </td>
<td style="width:40%">
<asp:TextBox ID="txtBirthDate" runat="server" Text="" ></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtenderBirthDate" TargetControlID="txtBirthDate" runat="server"
UserDateFormat="DayMonthYear" Mask="99/99/9999" MaskType="Date" ></ajaxToolkit:MaskedEditExtender>
</td>
</tr>
<tr><td colspan="3" style="float:right"><asp:Button Text ="Save" runat="server" ID="btnSave" OnClick="btnSave_Click"/> </td></tr>
</table>
</div>
And I am trying to get value from the txtFullname.I try txtFullname.Text and this.txtFullname but the application cannot see this values .
Can somebody how can I get the value for that textbox?
If that isn’t working for you, please use the below code for reference.
You have not included your “Register” directive. So, I took to privilege to give my own.
Change your markup to:
This code has been tested and is working.