Input Request

  • Thread starter Thread starter Thom Little
  • Start date Start date
T

Thom Little

Given the request ...
http://www.someurl.com/default.aspx?type=off

how can default.aspx read the values "type" and "off" from this example
using C# in ASP.NET?

In ASP it is something like ...
strWork = location.search.substring(0).split("&" )[0] ;
strLeft = strWork.split("=")[0] ;
strRight = strWork.split("=")[1] ;
 
Use the HttpRequest instance of System.Web.UI.Page.Request;
string s = base.Request.QueryString ["type"];
base.Response.Write(s); // Writes the string "off"

You may also use the HttpRequest to loop through the parameters.
 
Thank you. That was all the nudge I needed.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Dennis Myrén said:
Use the HttpRequest instance of System.Web.UI.Page.Request;
string s = base.Request.QueryString ["type"];
base.Response.Write(s); // Writes the string "off"

You may also use the HttpRequest to loop through the parameters.

--
Regards,
Dennis JD Myrén
Oslo Kodebureau
Thom Little said:
Given the request ...
http://www.someurl.com/default.aspx?type=off

how can default.aspx read the values "type" and "off" from this example
using C# in ASP.NET?

In ASP it is something like ...
strWork = location.search.substring(0).split("&" )[0] ;
strLeft = strWork.split("=")[0] ;
strRight = strWork.split("=")[1] ;
 
Back
Top