how to determine the aspx filename from ascx file in code behind.

Hello everyone,

Scenario:-
       test.aspx
       sample.ascx
       ASP.net 1.1 with vb on code behind.

Problem:- How can i find the name of test.aspx from sample.ascx in code behind. Sample.ascx is contained in test.aspx on html side.

I just like to retrieve "test.aspx" in text form to be used for some other purpose. Please suggest me. I like to perform this in the code behind of sample.ascx.
Thanks.

 
sainisherryAsked:
Who is Participating?
 
TimCotteeConnect With a Mentor Commented:
Hi sainisherry,

CurrentPage = page.tostring.substring(page.tostring.indexof(".")+1).replace("_",".")

Will give you this.

Tim Cottee
0
 
sainisherryAuthor Commented:
your solution worked.

Cheers mate.
0
All Courses

From novice to tech pro — start learning today.