I have been stuck on this for a few days because I was initially very confused and looking at code for a postback and storing my value in a hiddenfield,but looking at this further it's just using a "doSubmit" when I press the button.
The value I am trying to store should only be stored when a certain button is pressed, and multiple users may be using this site at a time, so I can't store it globally. In some kind of cookie may be possible if I can than access this value from my .aspx.cs file.
What I have : default.aspx
<asp:HiddenField id="HiddenValue" value =" "" runat="server"/>
//This may have to be changed to a standard hidden input field
<input name="button1" type="button" class="btn submitter" id="button1"
value="Copy" title="Create a copy of this id" onclick="SaveId(); doSubmit(); />
function SaveId() {
$('#<%=hiddenValue.ClientID%>').val("test");
}
Where "test" is the ID.
doSubmit is a function which does a document.form.submit()
I am really new to aspx and C#, and not so great at javascript and jquery, but I can see that test value being stored when the dosubmit is commented out, so I think I have that part right at least. What is the bet way to keep my value when I submit this form? Is it a cookie or is there some smarter way to do this?