Thursday, December 02, 2004 - Posts

Setting up wbloggar..

Desktop blogging is quite cool... setting up the bloggar was quite a breeze using the scott water site. http://scottwater.com/articles/desktop you can check out your meta blog api at dotnetjunkies.com/weblog/MyBLOG/services/metablogapi.aspx so the host is dotnetjunkies.com and your blog address would be weblog/MyBLOG/services/metablogapi.aspx
with 0 Comments

Using the Context.Item Collection

If you try to acces the session object you get an exception at the Application_BeginRequest(...)

You can, however, use Context.Items during Application_BeginRequest. This is an ideal spot to load request specific state to carry through until ASP.NET completes the request. You could, for instance, inspect the incoming request URL and load a preferences object with different settings if the site is balitmore.odetocode.com versus www.odetocode.com. Later, during the Load event of any page, you can inspect the Preferences object in the Items collection to make changes to the UI

protected void Application_BeginRequest(Object sender, EventArgs e)
{
string prefix = Request.Url.Host.ToUpper();
if(prefix.StartsWith("BALTIMORE"))
{
Context.Items["PREFERENCES"] = // Load Baltimore preferences
}
else
{
Context.Items["PREFERENCES"] = // Load default preferences
}
}
 
http://odetocode.com/Articles/111.aspx
with 0 Comments