Solved

Display same page file name

Posted on 2009-05-03
3
150 Views
Last Modified: 2012-05-06
Hello

I have an aspx page and it's called (MyForm.aspx), the thing is I want to dislpay this file name (MyForm.aspx) somewhere in my page, how do I do that?

VB.NEt code please :)
0
Comment
Question by:alfardan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ppittle earned 500 total points
ID: 24292602
You can use the HttpResponse object to obtain the virtual path from the FilePath Property:

Response.Write(Request.FilePath)

More info is available at: http://msdn.microsoft.com/en-us/library/system.web.httprequest.filepath(VS.80).aspx

If you just want the file and not the path you could do this:

Repsonse.Write(Path.GetFileName(Request.PhysicalPath))

PJ
0
 

Author Closing Comment

by:alfardan
ID: 31577438
I used (Response.Write(Request.FilePath))

However, Path.GetFileName(Request.PhysicalPath) gave me an error for the [Path] word in the syntax.

Thanks for providing alternative solution :)
0
 
LVL 8

Expert Comment

by:ppittle
ID: 24294850
Try Response.Write(System.IO.Path.GetFileName(Request.PhysicalPath))
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question