CHAN Reference

Chan Home | Reference Home | Event Firing Order | web.config

   

Location

    
  • Name Location
  • CSS Class NA
  • Type NA

The Location object represents a middle ground between Javascript's window.location and .Net's URI class. Various controls use a Location object to build their paths, for example the Form's action attribute.

The Chan.Page base class has a built in Location object that represents that page, it is this that child controls key off, so if you wanted a form to post back - but include or exclude a particular value from the querystring you can alter the page's Location.QueryString collection directly. This is in contrast to standard ASPX's Page.QueryString which is read only.

You can also spawn and manipulate your own Location objects as and when you need them, or Clone() them from the current page to start with a Location that represents the current page, then alter the querystring to suit, making for very simple construction of links and actions without needing to do any string manipulation.

Once you've built up a Location object you can assign it to a Link Href or even Response.Redirect to it by simply reading the Href or RelativeHref string properties, no string concatanation neccesary.