PC Review


Reply
Thread Tools Rate Thread

Is it correect to say that the div element is a control

 
 
Tony Johansson
Guest
Posts: n/a
 
      8th May 2011
Hello!

Here I have a HTML document.
I just wonder if it's correct to say that the div element in this document
is also a control.
My definition is that the div is of course an element but not a control.
I would say that a control is only those that has a visual appearance on the
form like table,TextBox, Label and so on.
Is this a correct interpretation ?

%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>My example</title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 154px;
}
</style>
</head>

<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style2"> Chose a color </td>
<td>
<input runat="server" id="btnRed" type="button" value="Red"
style="background-color: #FF0000; Width: 80px"
onserverclick="btnRed_ServerClick" /> &nbsp;
<input runat="server" id="btnGreen" type="button"
value="Green" style="background-color: #00FF00; width: 80px;"
onserverclick="btnGreen_ServerClick" /> &nbsp;
<input runat="server" id="btnBlue" type="button"
value="Blue" style="width: 80px; background-color: #0000FF;"
onserverclick="btnBlue_ServerClick" />
</td>
</tr>
<tr>
<td class="style2"> &nbsp; </td>
<td>
<div runat="server" id="DIV1"></div>
</td>
</tr>
</table>
</form>
</body>
</html>

//tony


 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      9th May 2011
On 08-05-2011 16:30, Tony Johansson wrote:
> Hello!
>
> Here I have a HTML document.
> I just wonder if it's correct to say that the div element in this document
> is also a control.
> My definition is that the div is of course an element but not a control.
> I would say that a control is only those that has a visual appearance on the
> form like table,TextBox, Label and so on.
> Is this a correct interpretation ?


A <div runat="server"> becomes a:
System.Web.UI.HtmlControls.HtmlGenericControl
so it is a control, but because it is a HtmlGenericControl and
not a HtmlDiv (that does not exist), then it is not very useful.

Arne
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what's the difference between a normal form element and a web control element? Masudur Microsoft ASP .NET 12 26th Mar 2007 06:33 AM
AJAX Control Toolkit: Element 'xxx' is not a known element =?Utf-8?B?TG91aXM=?= Microsoft Dot NET 0 9th Feb 2007 04:09 AM
Element 'Element Name Here' is not a known element. This can occur if there is a compilation error in the Web M Noreen Microsoft Dot NET 3 17th Apr 2006 07:28 AM
Form bound to a query does not return the correect records. =?Utf-8?B?TWljaGVs?= Microsoft Access Queries 1 5th Jan 2006 03:50 PM
Using xpcd to correect an error =?Utf-8?B?RU1BVU1BVQ==?= Windows XP Help 0 10th Feb 2004 01:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:33 PM.