Is there a way in ASP.NET/VB.NET to get the current form name.

  • Thread starter Thread starter Henry
  • Start date Start date
H

Henry

Is there a way in ASP.NET/VB.NET to get the current form name. I'd like
to store the name in a session variable for use on an Error page and use
it to return to the page that had the error.

Tks for any input.
 
Try the methods of StackFrame:

Dim objStackFrame As StackFrame

objStackFrame = New StackFrame

MessageBox.Show("You are in method " & objStackFrame.GetMethod.Name & " of
type " & objStackFrame.GetMethod.DeclaringType.FullName)
 
I'm sure there is a far easie or more reliable way, however, this seems to
work.

Label1.Text = Request.Path.Split("/")(Request.Path.Split("/").Length - 1)


--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
Tks for the suggestion. I ended up using the following:

Session("frmname") = Right(Request.ServerVariables("PATH_INFO"),
Len(Request.ServerVariables("PATH_INFO")) -
InStrRev(Request.ServerVariables("PATH_INFO"), "/"))
 
Cool, mine was a little easier I thought but thats just fine

Cheers

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top