Priyam Chandra
Priyam Chandra

Reputation: 1

How to give full path name for a file in asp.net

I want to give the full path for a file "Sample.xml" in ASP.NET in the following code

Response.Redirect("Sample.xml");

It does not work if I try like "C:\Users\abc\Documents\Visual Studio 2010\WebSites\WebSite1\Sample.xml"

Any suggestions please

Upvotes: 0

Views: 121

Answers (1)

Michael Biggs
Michael Biggs

Reputation: 460

Try

Response.Redirect(ResolveUrl("~/Sample.xml"));

I am assuming Sample.xml is in the root of your website.

Upvotes: 1

Related Questions