POST method in ASP.NET
-
how do you retreive the variable values that you post from one page, in the calling page? that is, in PHP you can use $variable=$_POST['control name'] is there a similar thing in ASP.NET? I want to know of a method other than passing variables with the URL.
-
how do you retreive the variable values that you post from one page, in the calling page? that is, in PHP you can use $variable=$_POST['control name'] is there a similar thing in ASP.NET? I want to know of a method other than passing variables with the URL.
The traditional way of retrieve the posted value is (common to ASP as well as ASP.NET),
Dim myname as String = Request.Form("Control Name")
If you use ASP.NET's Server controls, there is no need to use the traditional way. You just retrieve on the button click event as,
Dim myname as String = ControlName.Text
'Assume that the Control is a TextBox
Regards, Venkatesh Mookkan. Software Engineer, India
-
how do you retreive the variable values that you post from one page, in the calling page? that is, in PHP you can use $variable=$_POST['control name'] is there a similar thing in ASP.NET? I want to know of a method other than passing variables with the URL.
If you use the Server.Transfer method to move between your pages, you can also transfer your variable values using the HttpContext
Kind Regards, Gary
My Website || My Blog || My Articles