PC Review


Reply
Thread Tools Rate Thread

Basic understanding about the div tag

 
 
Tony Johansson
Guest
Posts: n/a
 
      1st Dec 2009
<%@ 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


 
Reply With Quote
 
 
 
 
Andrew Morton
Guest
Posts: n/a
 
      1st Dec 2009
Tony Johansson wrote:
> 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


What are you trying to achieve?

A <div> tag would typically be styled using CSS; various tutorials are
available, e.g.

http://www.w3schools.com/css/default.asp

Look at the page source in your browser to see how ASP.NET renders the
controls.

(Also, you will be better off putting your code in a code-behind page.)

HTH,

Andrew


 
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
Basic way to make basic databases work on Access2007? Fred Microsoft Access 5 8th Apr 2010 04:47 PM
Help understanding Vista Home Basic and Hard Drive reccognition? jim Windows Vista Performance 0 30th Jan 2008 10:25 PM
have window vista basic.understand basic don't have fax & scan jay sureka Windows Vista Print / Fax / Scan 4 7th Jan 2008 07:02 PM
Basic Difference between Visual Basic 6 and Microsoft Access VBA =?Utf-8?B?SXJzaGFkIEFsYW0=?= Microsoft Access 2 5th Apr 2007 12:34 PM
need a basic understanding stevemiller Windows XP Accessibility 8 31st Jan 2004 07:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 AM.