I have a JavaScript function document.form1.submit()
and I am wondering how to receive it in the code behind. In which class and method should I be looking? I need to get the value from a textbox and store it in session, but I'm not sure if I need an actual submit button for this to work. It's all very confusing.
If I use the following code:
function CallSubmit() {
var thetext = document.getElementById('textbox1').value;
document.form1.submit(thetext);
}
Will I be able to pass the value of textbox1 to a specific method in the code behind that has a receiving variable? How can I retrieve the value of textbox1?
Also, I am trying to do this before the page unloads so that I can save the text from textbox1 and reassign it after the page refreshes.