i am nwe to jquery.how i get value of hidden field after post back in csharp. when ever post back occures value dissapear. this is my hidden field.
<asp:HiddenField ID="Hid_BasicSalary" runat="server" />
this is jquery code where is assign data to it after succsesful execution of ajax web service.
var BasicSalary = $('Hid_BasicSalary');
BasicSalary.val(data["BasicSalary"]);
this is c sharp code when i click on button postback occurs afte this node data.
protected void Btn_PIncrementSave_Click(object sender, EventArgs e)
{
try
{
TxBx_IncrementAmount.Text = Hid_BasicSalary.Value.ToString();
}
catch (Exception ex)
{
Utility.Msg_Error(this.Master, ex.Message);
}
}
please help me
In jQuery we use the selector for select any elements, and we have to put .
for the class and #
to the id selector so please put #
or .
before your element.
In your case, $('#Hid_BasicSalary');
or $('.Hid_BasicSalary');
is your answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With