Click here to Skip to main content
15,885,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Thanks in advanced

client side set hiddenfield value and that hiddenfield value how to use in server side
Posted
Comments
Ankur\m/ 22-Apr-14 4:01am    
hiddenFieldId.Value
What's the problem? What did you try?

1 solution

I do not understand where you are having issue but this should just work fine:
Note that I am using jQuery syntax as you have tagged jQuery in the question.
XML
<asp:HiddenField ID="HiddenField1" runat="server" />
<script type="text/javascript">
    $(document).ready(function () {
        $("#<%=HiddenField1.ClientID %>").val("NewValue");
    });
</script>


In the code behind, you can access the control by it's id like below:
C#
string hiddenFieldValue = HiddenField1.Value;


Hope that helps!
 
Share this answer
 
Comments
keyur_raval 22-Apr-14 6:15am    
i am using this way but not done work properly...show another way please give me.....
Ankur\m/ 22-Apr-14 7:44am    
What is not working properly? You need to give more detail. I just tested it and it works pretty well for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900