Passing hidden variables to Vb.net

I want to pass multiple variables to another page. I am currently using response.redirect and passing variables to url. I am not interested in using session variables. Is there a way to pass hidden variables in .NET to a completely different form?

+1


a source to share


4 answers


(You can also use Server.Transfer () and not lose Request.Form data .)



+1


a source


you can use

Server.Transfer("Your transfer page url")

      



server.transfer will transfer the entire variable of the current page to another translated page.

+1


a source


There are three ways to transfer data to the next page:

  • In the query string

    This is limited by the size of the URL that the browser can handle, around 1000 characters are considered safe.

  • In form data

    This requires you to post the form instead of using Response.Redirect

    . You can put hidden fields on the page. The values ​​are thus not completely hidden as they might be visible in the page source and they are sent in the request, but not immediately displayed as in the URL.

  • In session variables

    This does not send data directly, instead only the session id is sent in the request (as a cookie), the session variables never leave the server.

There is a slight difference between the methods used when a user has more than one window open showing pages from your site. In the first two methods, each window has its own set of data, but using the third method means that all windows use the same data.

0


a source


You can try cookies, but you can still see what they are if you look and are not very reliable. I would go with session variables as in Syed's example.

0


a source







All Articles