T
Tony Johansson
<%@ Page Language="C#" %>
Hello!
I must say I have been using C# for 1.5 years but asp.net is new to me.
I have not been using html much either.
Below is a simple aspx page below.
I wonder in the code-behind there is a div tag where the two asp.net control
is placed in.
I can for example move this row
<asp:Label ID=lblMyLabel runat=server />
after the div tag
I can also remove the div tag completely.
I both cases there is no visual difference when I run this aspx page
So I wonder can somebody tell me some basic understanding about how to use
this div tag
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void btnMyButton_Click(object sender, EventArgs e)
{
lblMyLabel.Text = "Någon <b>klickade</b> på knappen!";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<H3>Ett enkelt webbformulärexempel</H3>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnMyButton" runat="server"
OnClick="btnMyButton_Click" Text="Min knapp" /><br />
<asp:Label ID=lblMyLabel runat=server />
</div>
</form>
</body>
</html>
//Tony
Hello!
I must say I have been using C# for 1.5 years but asp.net is new to me.
I have not been using html much either.
Below is a simple aspx page below.
I wonder in the code-behind there is a div tag where the two asp.net control
is placed in.
I can for example move this row
<asp:Label ID=lblMyLabel runat=server />
after the div tag
I can also remove the div tag completely.
I both cases there is no visual difference when I run this aspx page
So I wonder can somebody tell me some basic understanding about how to use
this div tag
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void btnMyButton_Click(object sender, EventArgs e)
{
lblMyLabel.Text = "Någon <b>klickade</b> på knappen!";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<H3>Ett enkelt webbformulärexempel</H3>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnMyButton" runat="server"
OnClick="btnMyButton_Click" Text="Min knapp" /><br />
<asp:Label ID=lblMyLabel runat=server />
</div>
</form>
</body>
</html>
//Tony