Geeks With Blogs

Tangible Thoughts SharePoint, MOSS? and all the other questions

Do you guys know about these bugs?

- 320439

- 817036

Well theres a simmilar issue with SharePoint, and I suspect that its ASP.NET at play underneath.

Try this create a webpart that tries to transfer control onto another page in SharePoint.

for e.g.

protected override void RenderWebPart(HtmlTextWriter output)
{

try

{
Context.Server.Transfer(defaultText);
// Context.Server.Execute(defaultText);
}

catch
(Exception e)
{
output.Write(e.ToString());
}
}

What you should see on the WebPart page is error "Error executing child request for ./test.aspx."

And just think everywhere else Server.Transfer or Server.Execute are proposed as less stressfull alternatives to Response.Redirect.

Posted on Wednesday, August 4, 2004 2:20 PM SharePoint | Back to top


Comments on this post: Server.Transfer wont work in a WebPart

# re: Server.Transfer wont work in a WebPart
Requesting Gravatar...
I remember that SPS don't allow relative path with "./"
Can you try with a real path for test ?
Left by Renaud COMTE on Aug 04, 2004 3:29 PM

# re: Server.Transfer wont work in a WebPart
Requesting Gravatar...
I rememeber full paths didnt work either
Left by Tariq on Aug 05, 2004 8:45 AM

# re: Server.Transfer wont work in a WebPart
Requesting Gravatar...
I think I can answer this for you; I was doing something similar, but was trying to use server.transfer to get from an unmanaged path to a managed path, e.g. from a real default.aspx page to a sharepoint handled one. It won't work because it tries to demand a FileIOPermission which assumes that the target files actually exists on disk, which of course it doesn't when we're talking about ghosted/unghosted pages.

Hope this helps!

- Oisin
Left by Oisin Grehan on Jan 27, 2005 7:00 PM

# re: Server.Transfer wont work in a WebPart
Requesting Gravatar...
Yes I am also getting the same error with SPS 2003 and webpart created in ASP 1.1

in btn1_click System.Web.HttpException: Error executing child request for /Test/default.aspx.
at System.Web.HttpServerUtility.ExecuteInternal(String path, TextWriter writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path)
at SM_webpart1.SM_WebPart1.btn1_click(Object sender, EventArgs e)
Left by kiran khambete on Mar 03, 2005 1:08 PM

# re: Server.Transfer wont work in a WebPart
Requesting Gravatar...
Ue Response.Redirect
Left by khan on Aug 25, 2005 6:44 AM

# re: Server.Transfer wont work in a WebPart
Requesting Gravatar...
use SPUtility.Redirect instead
Left by fussytroll on Jul 30, 2010 2:14 PM

Your comment:
 (will show your gravatar)


Copyright © Tariq | Powered by: GeeksWithBlogs.net