Click to See Complete Forum and Search --> : form name.


StyM
January 22nd, 2004, 03:40 AM
hello and Good Day.

may i know how i can retrieve the name of my form from my asp page??? i have tried Context.Request.Form but there is just no method to retrieve the name of the form.

how can i do this???

thanks for the help.

BMeister
January 23rd, 2004, 05:55 AM
Hi StyM,

A couple of options for getting the name of a page in your code-behind using the page's Request object are as follows

string name2 = Request.Url.AbsolutePath;

This gives you the whole path of the page and you can parse out the namne of the page. Alternatively you can use the following;

string [] name3 = Request.Url.Segments;

which gives you the path split into it's segments, one of which will be the name of the page.

Hope this is helps.