468,507 Members | 1,580 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,507 developers. It's quick & easy.

Creating HttpHandlers

I have the following code within the ASP.NET project I
have created.

public class RedirectHandler : IHttpHandler{
//empty constructor
public void ProcessRequest(HttpContext context){
response.Redirect("page2.aspx");
}
public bool IsReusable(){
get {return false;}
}
}

then in the Web.config file, within the <System.web> I
have

<httpHandlers>
<add verb="*" path="*/xxx" type="RedirectHandler" />
</httpHandlers>

Basically, what I'm trying to do is, when a user enters,
www.xyz.com/xxx, I want the browser to redirect to
www.xyz.com/xxx.aspx. I don't mind if the user sees the
url in the address. There is no page named xxx. The
page is xxx.aspx but I don't want the person to HAVE to
enter the extension. They can but I don't want them to
HAVE to.

When I run the program, I get the following error.

Description: An error occurred during the processing of a
configuration file required to service this request.
Please review the specific error details below and modify
your configuration file appropriately.

Parser Error Message: Could not load type
DistributorRedirectHandler from assembly System.Web

It then highlights the <add verb="*" .....
line. Can anyone explain what this error message means
and how I can address it?

thanks,
Prince
Nov 18 '05 #1
2 1273
It could also be a directory: For example, if you type
into your browser www.microsoft.com/developer it is
redirected to another page. I wish to do something as
simple as that since I don't have access to IIS. My
website is being hosted so I would like to accomplish the
same thing or something very similar.

-----Original Message-----
I have the following code within the ASP.NET project I
have created.

public class RedirectHandler : IHttpHandler{
//empty constructor
public void ProcessRequest(HttpContext context){
response.Redirect("page2.aspx");
}
public bool IsReusable(){
get {return false;}
}
}

then in the Web.config file, within the <System.web> I
have

<httpHandlers>
<add verb="*" path="*/xxx" type="RedirectHandler" />
</httpHandlers>

Basically, what I'm trying to do is, when a user enters,
www.xyz.com/xxx, I want the browser to redirect to
www.xyz.com/xxx.aspx. I don't mind if the user sees the
url in the address. There is no page named xxx. The
page is xxx.aspx but I don't want the person to HAVE to
enter the extension. They can but I don't want them to
HAVE to.

When I run the program, I get the following error.

Description: An error occurred during the processing of aconfiguration file required to service this request.
Please review the specific error details below and modifyyour configuration file appropriately.

Parser Error Message: Could not load type
DistributorRedirectHandler from assembly System.Web

It then highlights the <add verb="*" .....
line. Can anyone explain what this error message means
and how I can address it?

thanks,
Prince
.

Nov 18 '05 #2
Google: "url rewriting" and variants as there are many articles
that document the objective.
--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Prince" <an*******@discussions.microsoft.com> wrote in message
news:21*****************************@phx.gbl...
It could also be a directory: For example, if you type
into your browser www.microsoft.com/developer it is
redirected to another page. I wish to do something as
simple as that since I don't have access to IIS. My
website is being hosted so I would like to accomplish the
same thing or something very similar.

-----Original Message-----
I have the following code within the ASP.NET project I
have created.

public class RedirectHandler : IHttpHandler{
//empty constructor
public void ProcessRequest(HttpContext context){
response.Redirect("page2.aspx");
}
public bool IsReusable(){
get {return false;}
}
}

then in the Web.config file, within the <System.web> I
have

<httpHandlers>
<add verb="*" path="*/xxx" type="RedirectHandler" />
</httpHandlers>

Basically, what I'm trying to do is, when a user enters,
www.xyz.com/xxx, I want the browser to redirect to
www.xyz.com/xxx.aspx. I don't mind if the user sees the
url in the address. There is no page named xxx. The
page is xxx.aspx but I don't want the person to HAVE to
enter the extension. They can but I don't want them to
HAVE to.

When I run the program, I get the following error.

Description: An error occurred during the processing of

a
configuration file required to service this request.
Please review the specific error details below and

modify
your configuration file appropriately.

Parser Error Message: Could not load type
DistributorRedirectHandler from assembly System.Web

It then highlights the <add verb="*" .....
line. Can anyone explain what this error message means
and how I can address it?

thanks,
Prince
.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by some guy with a computer | last post: by
reply views Thread by Chance Hopkins | last post: by
1 post views Thread by Patrick Kristiansen | last post: by
1 post views Thread by TJoker .NET | last post: by
4 posts views Thread by Grant Harmeyer | last post: by
reply views Thread by tshad | last post: by
5 posts views Thread by Anonieko | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.