Hello guys i am new in asp.net .i want to get values of inputbox using server contol (asp.net ,c#) but am not getting null values of inputbox .any one help me? Thanks in advance.

my code sample is as follows

    <div class="form-group"> <label for="">Current Location<span class="text-red">*</span></label> <asp:TextBox runat="server" ClientIDMode="Static" class="form-control" ID="txtCurrentLocation" name="txtCurrentLocation" type="text"></asp:TextBox> <asp:RequiredFieldValidator ID="rfvCurrentLocation" runat="server" ControlToValidate="txtCurrentLocation" Display="Dynamic" ErrorMessage="Required!" CssClass="sfRequired" ValidationGroup="UpdateCourier"> </asp:RequiredFieldValidator> </div>

 <asp:LinkButton runat="server" OnClick="btnUpdateCourier_Click" class="btn btn-blue" ID="btnUpdateCourier" ToolTip="Update" Text="Update" ValidationGroup="UpdateCourier" />

//my server-side code

   protected void btnUpdateCourier_Click(object sender, EventArgs e)
{


        string courier=  txtCurrentLocation.Text;
}

why "txtCurrentLocation.Text" gives null value?

Related posts

Recent Viewed