Connecting Tech Pros Worldwide Forums | Help | Site Map

System.Web.UI.Page and finding the <body>

sloan
Guest
 
Posts: n/a
#1: Aug 25 '06

If my html looks like this (page1.aspx)

<HTML>
<HEAD>
<title>WebForm1</title>

</HEAD>
<body>
<form id="Form1" method="post" runat="server">

<asp:TextBox id="TextBox3" runat="server"></asp:TextBox>correct
email</P>

</form>
</body>
</HTML>


In the codebehind., I have the "System.Web.UI.Page" object as my disposal.

Is there a way to get hold of the <bodytag in the code behind.
What I'm getting at is a function like below.


private void Test( System.Web.UI.Page p )
{
//find the body ??
}

Or is there another way?

...



Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
#2: Aug 25 '06

re: System.Web.UI.Page and finding the <body>


If you give your Page's BODY tag a runat=server attribute, it will act like
any other server control. Of course, the actual goal here, which you haven't
stated, may mean you really need to be doing something different.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"sloan" wrote:
Quote:
>
If my html looks like this (page1.aspx)
>
<HTML>
<HEAD>
<title>WebForm1</title>
>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
>
<asp:TextBox id="TextBox3" runat="server"></asp:TextBox>correct
email</P>
>
</form>
</body>
</HTML>
>
>
In the codebehind., I have the "System.Web.UI.Page" object as my disposal.
>
Is there a way to get hold of the <bodytag in the code behind.
What I'm getting at is a function like below.
>
>
private void Test( System.Web.UI.Page p )
{
//find the body ??
}
>
Or is there another way?
>
...
>
>
>
Closed Thread