logo       

Re: how do i get the form name attribute value?: msg#00137

windows.devel.dotnet.web

Subject: Re: how do i get the form name attribute value?

string name = ((HtmlForm)ctrl).Name;


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-WEB@xxxxxxxxxxxxxxxxxxx] On Behalf Of Alex Smotritsky
Sent: Monday, June 27, 2005 14:11
To: DOTNET-WEB@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-WEB] how do i get the form name attribute value?

Unfortunately not.

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-WEB@xxxxxxxxxxxxxxxxxxx] On Behalf Of Christopher Reed
Sent: Monday, June 27, 2005 10:06 AM
To: DOTNET-WEB@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-WEB] how do i get the form name attribute value?

Name is a property of HtmlForm, so you should be able to use ctrl.Name.

Christopher Reed
Web Applications Supervisor
Information Technology
City of Lubbock
creed@xxxxxxxxxxxxxxxxxxxxx
"The oxen are slow, but the earth is patient."

>>> alex_smotritsky@xxxxxxxxx 6:41:24 AM 6/27/2005 >>>
I've added a name attribute to my webform and now would like to know how to
read it. I think it should be easy since name is one of the standard
attributes of form.

I get the form id value like this:

string id = "";
foreach(Control ctrl in Page.Controls)
if (ctrl is System.Web.UI.HtmlControls.HtmlForm)
{
id = ctrl.ID;
break;
}

Don't see how to get name though, thanks for any help.

===================================
This list is hosted by DevelopMentor. http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor. http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise