Hi nail:
One thing that seems a little odd is the way you check the Url
property during Init. The Init method will only be invoked once and
then the module will be reused for several requests. If the first
request then, is not for "webadmin", then you'll never be hooking the
PreRequestHandlerExecute event.
Instead, I'd always hook that event and then check the URL during the
Begin_Request event.
--
Scott
http://www.OdeToCode.com/
Ok Scott.
Here's the httpmodule class:
Thanks again.
public class STHttpModule : IHttpModule
{
private Page pg;
public void Init(HttpApplication httpApp)
{//Check if the page is the asp.net configuration. if is, not execute
the
http module handler.
if (httpApp.Context.Request.Url.ToString().ToLower().IndexOf("webadmin")
== -1)
httpApp.PreRequestHandlerExecute += new
EventHandler(httpApp_PreRequestHandlerExecute);
}
public void Dispose()
{
// not necessary
}
void pg_PreInit(object sender, EventArgs e)
{
if (pg.Request["CurrentTheme1"] != null)
pg.Theme = pg.Request["CurrentTheme1"].ToString();
}
void httpApp_PreRequestHandlerExecute(object sender, EventArgs e)
{
pg = (Page)HttpContext.Current.Handler;
pg.PreInit += new EventHandler(pg_PreInit);
}
}
Hi nail:
We would have to know a little bit about what the HttpModule does. Can
you post some code?
--
Scott
http://www.OdeToCode.com/
Folks,
I develop a HttpModule and it works correct, but one problem is
occurs.
After I register the httpmodule in the web.config, my pages (not
testing
http://localhost/site but
http://my_machine_name/site) show problems
when
refresh the page.
I guess some kind of javascript problems with the postback methods.
Someone has any idea how can i fix it?
Thanks
nail