Help and Support
 

powered byLive Search

PRB: Page.ResolveUrl Method Does Not Return Path in ASP.NET 1.1

Article ID:811641
Last Review:May 12, 2003
Revision:1.5
Beta Information
This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about how to obtain support for a Beta release, see the documentation that is included with the Beta product files, or check the Web location from which you downloaded the release.
On This Page

SYMPTOMS

When you specify a Web Page while calling the Page.ResolveUrl method, the ResolveUrl method does not return the relative path of the page. This problem occurs in ASP.NET version 1.1. However, this problem does not occur in ASP.NET version 1.0.

Back to the top

CAUSE

This problem occurs because the behavior of the ResolveUrl method of the Page class has been changed in Microsoft .NET Framework version 1.1 from the behavior in version 1.0.

Web Controls use the ResolveUrl method to resolve the URL. In ASP.NET version 1.1, when the RelativeUrl parameter contains an absolute URL, the ResolveUrl method returns the URL unchanged.

Back to the top

WORKAROUND

To work around this problem, use the Page.Server.MapPath property to retrieve the path of the Web page.

Back to the top

STATUS

This behavior is by design.

Back to the top

Steps to Reproduce the Behavior

1.In Microsoft Visual Studio .NET 2003, create a new ASP.NET Web Application project by using Visual Basic .NET or Visual C# .NET.
2.In Design view, double-click Form1 to view the code for the Page_Load event.
3.Add the following code to the Page_Load event:

Visual Basic .NET Sample Code
Response.Write(Page.ResolveUrl("WebForm1.aspx"))
Visual C# .NET Sample Code
Response.Write(Page.ResolveUrl("WebForm1.aspx"));
4.On the Debug menu, click Start to run the project. WebForm1.aspx appears without the path.

Back to the top

REFERENCES

For more information, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/system.web.ui.control.resolveurl(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.web.ui.control.resolveurl(vs.71).aspx)

Back to the top


APPLIES TO
Microsoft ASP.NET 1.1

Back to the top

Keywords: 
kbwebforms kbweb kbprb kbusage kbcontrol KB811641

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.