c# - How to post params from javascript to asp.net? -
I have a JavaScript code that creates a link with 2 parameters.
Now, I know how using these addresses after these consultations, but I do not want to use it.
I have tried to use cookies to post nuclear, but somehow I can not read them on server side.
This is the client side code
document.cookie = "name =" + "value"; This server is the side reading code
string s = Response.Cookies [cookieName]. Value; Can you exclude me out?
create a short form (an asp.NET web form, just a simple one) two paragraph forms Two input types named in with hidden areas. Next, a link or button tie a onclick event on a Java function (Example: onclick = "javascript: postIt ();")
Then when the user clicks the button or link, the function will change the value of those parameters such as:
document.miniform.parameter1.value = yourvalue1; Document.miniform.parameter1.value = yourvalue2; Document.miniform.submit (); Request.form ("parameter1") and so on to retrieve the parameters in the code usage ...
Comments
Post a Comment