How to save value of HiddenField in sql?

77 Views Asked by At

I want to save the value of my HiddenField in the database. But I don't know what comes after the comma.

cmd.Parameters.AddWithValue("@hfLat", what goes here?)

I tried:

cmd.Parameters.AddWithValue("@hfLat", HiddenField.Value); // Doesn't work.

html:

 <asp:HiddenField ID="hfLat" runat="server" />

1

There are 1 best solutions below

0
Win On

You want to access control via Id which is hfLat in this case.

cmd.Parameters.AddWithValue("@hfLat", hfLat.Value);