Click here to Skip to main content
15,896,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI
i want to pass prevoius page hidden field value in current page

how can i get it directly in jquery,,
or else

how to get value in asp.net and pass value from asp.net to jquery

pls advice

regards
maulik shah
Posted

You have to pass the HiddenField value from previous page to the next page by QueryString or storing that in Session.

So, do any of the above and you can get its value in next page.
 
Share this answer
 
Put This in your head tag

XML
<script type="text/javascript">
        function callit() {

            var ele = document.getElementById("hiddenfield");
            var x = parseInt(ele.value) + 1;
            document.getElementById("hiddenfield").value = x;
            $("#<%=Label1.ClientID %>").text(x);
        }
    </script>




put follwoing in your body tag


XML
<input type="hidden" id="hiddenfield" value="0"/>
       <asp:Label ID="Label1" runat="server" Text="hello"></asp:Label>
   <div id="MyDiv">This is my div</div>
    <input id="Button2" type="button" onclick="callit()" value="button"  />
 
Share this answer
 
You cannot get the previous page hidden value .

if in case it is a popup windows, you can get through document.opener.getelementbyid......

u can use the following to get the values

1) Query string to get the values

2) Session Variables

3) Cookies

have a look at this link for more info on State management

State Management in ASP.NET - Introduction[^]
 
Share this answer
 

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