I am working with a application in which I assign a value to hidden field dynamically problem is that I am not able to get the value in jquery code.
I will debug it and C# code give me value now I am not able to use this hidden field value in jquery code please help me to solve my problem.follwing my code
C# Code
[webmethod]
public static void Data(string add)
{
ObjectParameter Test;
Test = new ObjectParameter("id", typeof(Int32));
Test.Value = DBNull.Value;
using (var db = new MyEntities())
{
db.Mytest(
Add = add,
Test
);
HiddenField myhiiden = new HiddenField();
myhiiden.Value = Convert.ToString(Test.Value);//// here I got id value when I debug it it dynamically change but I have no method to assign and excess these value plese help me following my method to access these value in jquery function.
}
}
JQuery
myhiiden = $("[ myhiiden]").val();
alert($('[myhiiden]').val()); but I can’t got any value
my hidden filed definition
<input runat="server" type="hidden" value="" id=" myhiiden " ClientIDMode="Static" />
Please help me how I use this hidden field in jqury and get on alert.