home
links
tips

code
users
tools
tutorials
projects
web
help
design

mudabone
suletzki
trans48
nutrition reality

MarthaAttire!

code Get Request


.NET returns errors when you try to use a request item that doesn't exit... so I use this simple stuff in virtually all of my web stuff.

          private string getRequest(string sRequest)
          {
               return getRequest(sRequest,"");
          }

          private string getRequest(string sRequest, string sDefault)
          {
               string s = Request[sRequest];
               if (s == "" | s == null)
                    return sDefault;
               else
                    return s;
          }


back to code


Comments:

From 24.39.51.197 - 12/13/04 11:04 AM

You are better off using Request.Params

if (Request.Params["QueryStringVariableHere"] != null)

{

...

}



Last Modified 8/20/03 4:44 AM

Hide Tools