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

Hello everyone,

       sample.ascx 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.

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
sainisherryAuthor Commented:
your solution worked.

Cheers mate.
All Courses

From novice to tech pro — start learning today.