473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1434
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add...
2
by: Luis | last post by:
Hi, I want to protected all files in my website, so I try to use httpHandlers, I put this in my WEB.CONFIG (at the end of page), but I can't protected the files type MDB, CSB, can someone help...
0
by: Chance Hopkins | last post by:
Does anyone know how to get a custom httpHandler to fire for all applications in machine.config for an assembly in the GAC, without using seperate location tags? For instance, this works for a...
1
by: Patrick Kristiansen | last post by:
Hi! I have on my website a root web.config file, and also created a subapplication "/publikationer". In my root web.config I've specified an HTTP-handler for some requests, but this is mirrored...
1
by: TJoker .NET | last post by:
I have this web control that need to process some special urls requested by the browser. So I created a class implementing IHttpHandler to deal with it. The problem here is that to properly use...
4
by: Grant Harmeyer | last post by:
How would I set up an httpHandler so that it would only apply to certain child directories of the application? I.E: <httpHandlers> <add verb="*" path="/files/*/*/*/*.aspx"...
3
by: MWells | last post by:
I'm having an issue getting my HttpHandlers and HttpModules to play together nicely. My HttpHandlers take special document types (defined by extension) and process them specially. I might have...
0
by: tshad | last post by:
I have 2 controls that I need to run that I got of the Web. I have been using ScrollKeeper for awhile and was trying to add FreeTextBox to my site. But for some reason it won't run if ScrollKeeper...
5
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.