javascript - how is document.form.submit() received in code behind? -


I have document.form1.submit () in javascript. I want to know how it got behind this code. In which class, in which method? something like that. Coz I want to get the value inside a text box to store it in one session. And do I need a real "submit" button for this? It really confuses me.

If I keep it like this:

  function callSubmit () {var thetext = document.getElementById ('textbox1'). Value; Document.form1.submit (thetext); }   

Can I be able to pass the value of textbox1 to the code behind a specific method, if so, such as, a received variable? I mean, how can I get the value of textbox 1?

By the way, I am trying to do this before landing the page. Because I need to store text from TextBox 1, so that I can allocate the value again after page refresh.

You can get value back to post using 'form' as 'back'.

  request. Form ["textbox 1"]   

and if you request this . Read the form You get all the data from the post

Comments . In Asp.net, we usually use the directly request form. and we use asp.net controls that handle all ready post values. For example, if you use asp: textbox by id = text box 1 then you can read the post from textBox1.Text and if you want to If you want to read it using Request.Form , you must call request.form [textbox1.UniqueID]

textBox1. UniqueID is the name value on the html control, and the names used for the post.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -