Re: how to get the name of the current aspx file?



"Dave" <sdsds@xxxxxxx> wrote in message
news:eblRdjohHHA.588@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

i need to get the name of the current aspx file in code-behind.
Assume the current aspx file is "myfile.aspx", i want to put value
"myfile" into a variable in code-behind.
Is that possible?


You can get the name of the current _class_ via GetType().Name. This may or
not be the name of the file, but then I can't tell if you mean file or
class.
--

John Saunders [MVP]


.



Relevant Pages

  • Re: asp.net good practices?
    ... programmatic logic code from the presentation layer. ... "Page" class and the class generated from the .aspx file. ... methods and event handlers in your code-behind class and have these ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Simple datalist question
    ... and then moved your c# code from the new aspx to the code-behind? ... one thing you're missing is that when you drop a control on a form ... So by doing this, when the aspx file is loaded, the variable declaration is inherited from the code-behind class, and .NET automatically associates the loaded control in the page to it.. ...
    (microsoft.public.dotnet.framework.aspnet)
  • problem with connecting gridview with data in code-behind
    ... code-behind. ... The problem is that the gridview remains invisible because no records come ... code in aspx file ... Dim dtreader As SqlDataReader ...
    (microsoft.public.dotnet.framework.aspnet)
  • how to pass variable to SelectCommand of SqlDataSource?
    ... I want to put a recordset in a gridview but i don't know how to pass the ... i added a tag <selectParameters> but i don't know ... This is my aspx file: ... The code-behind contains this: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Design flow for Code-behind
    ... Many have said that code-behind is best if working in teams - ... Do you typically let the designer build the page first with the ... As you change html objects to asp objects you would need to ... are making changes to the code-behind since the aspx file would refer to it. ...
    (microsoft.public.dotnet.framework.aspnet)