473,419 Members | 1,689 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,419 software developers and data experts.

problem in httphandler (server.execute)-please urgent..

hi,

i have problem in httphandler, my problem is that when i am trying to
use server.execute(/default.aspx) i am getting error....

[Error executing child request for /Default.aspx]
Here i am trying to redirect from home.aspx to default.aspx (both file
isin sharepoint).I have give a copy of my code below..

public class UrlMap : System.Web.UI.Page,IHttpHandler,
IRequiresSessionState
{

public new bool IsReusable { get { return false; } }
public new void ProcessRequest(HttpContext context)
{
string requestedUrl = context.Request.Url.ToString();
if(requestedUrl.IndexOf("/Home.aspx")!=-1)
{
context.Server.Execute("/Default.aspx");
}
}
}
The same code is working fine when i am using
server.Transfer("/Default.aspx")...
Please anyone can help how to rectify this problem...
It is vey urgent...
mail Adresss : na*******@gsdindia.com

bye
sathya narayanan

Nov 17 '05 #1
1 2780
Sathya,

Are you trying to get the contents of Default.aspx to be rendered when
you go to Home.aspx, without actually redirecting to that URL? If that is
the case, then why not create a new instance of the class the Default.aspx
is represented by, and then just call the ProcessRequest method on that
implementation.

Also, you do not need to derive from Page to implement IHttpHandler, and
you don't need session state for what it seems like you are doing (if that
is the only code).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"sathya" <sa***************@gmail.com> wrote in message
news:11********************@g43g2000cwa.googlegrou ps.com...
hi,

i have problem in httphandler, my problem is that when i am trying to
use server.execute(/default.aspx) i am getting error....

[Error executing child request for /Default.aspx]
Here i am trying to redirect from home.aspx to default.aspx (both file
isin sharepoint).I have give a copy of my code below..

public class UrlMap : System.Web.UI.Page,IHttpHandler,
IRequiresSessionState
{

public new bool IsReusable { get { return false; } }
public new void ProcessRequest(HttpContext context)
{
string requestedUrl = context.Request.Url.ToString();
if(requestedUrl.IndexOf("/Home.aspx")!=-1)
{
context.Server.Execute("/Default.aspx");
}
}
}
The same code is working fine when i am using
server.Transfer("/Default.aspx")...
Please anyone can help how to rectify this problem...
It is vey urgent...
mail Adresss : na*******@gsdindia.com

bye
sathya narayanan

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Paul | last post by:
Hi all When sending a GET request with MSXML2.XMLHTTP to a HttpHandler on the web-server the case seems to have been stripped down to lower-case. This was working fine under our Windows 2000...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
4
by: Igor K | last post by:
Hi all, I'm developing asp.net website. Most of the pages are aspx, but let's say, some 10% are html. For this html pages i use httphandlers to intercept calls and to perform some job on this...
4
by: Jeremy Lew | last post by:
When my HttpHandler is processing a request when installed on a particular 2003 Server machine, the Context.Session object is null. Any idea why this might be? My handler implements...
6
by: Sam | last post by:
My problem is that when I am trying to use Server.Execute("Somehandler.ashx") I am getting HttpException. System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer,...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
5
by: the4man | last post by:
Hi all! I have an app that show images that are stored in SQL Server. To show the images on screen, until now (with the "old" ASP), I use the following code: <img src="showimage.asp?id=20"...
3
by: Jeeran | last post by:
I need to perform url rewriting to convert this (for example): /blogs/feeds/popular/posts/ to this: /blogs/feeds.aspx?type=popular&type2=posts What I did was the following: 1. Created an...
5
by: zlf | last post by:
Hello, I try to use a custom HttpHandler to add something to session, then display the original page. public void ProcessRequest(HttpContext context) { context.Session = "test"; } But, a...
1
by: mmorrison93 | last post by:
Thanks in advance for any help on this problem, but i have an HttpHandler that looks at the requested url and and tranfers context to a particular file. The problem is the transfer will only work...
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...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.