ASPNET 2.0 do I need to put everything inside <div>

ASPNET 2.0 do I need to put everything inside <div>

am 08.04.2008 15:07:31 von ckkwan

We know we need to put inside the

element, because the ASP
control needs postback.

If a particular ASP control doesn't need postback, it doesn't really
need to be inside the element.

Now, why there is a
element inside the and it seems to me
that everybody is putting their ASP controls in it.

Thanks in advance.

Re: ASPNET 2.0 do I need to put everything inside <div>

am 08.04.2008 15:41:16 von Aidy

You don't have to put your controls inside a . Not 100% sure on the
rules, but individual controls that need the viewstate seem to error if
placed outside the . However you can put custom controls outside the
.

In above I assume is a server-side form with runat="server"

If you want to use non-ASP controls you can put them outside the form, or
you can even have multiple forms on the page as long as only one has
runat="server" and they are not nested.

You don't need to put your controls in the

either, you can delete it,
it is just part of the blank page template.

wrote in message
news:6752a7ac-77a8-4fe8-8e3b-851201934704@r9g2000prd.googleg roups.com...
> We know we need to put inside the element, because the ASP
> control needs postback.
>
> If a particular ASP control doesn't need postback, it doesn't really
> need to be inside the element.
>
> Now, why there is a
element inside the and it seems to me
> that everybody is putting their ASP controls in it.
>
> Thanks in advance.
>

Re: ASPNET 2.0 do I need to put everything inside <div>

am 09.04.2008 00:01:27 von Steve Kershaw

On Apr 8, 7:41=A0am, "Aidy" wrote:
> You don't have to put your controls inside a . =A0Not 100% sure on t=
he
> rules, but individual controls that need the viewstate seem to error if
> placed outside the . =A0However you can put custom controls outside =
the
> .
>
> In above I assume is a server-side form with runat=3D"server"
>
> If you want to use non-ASP controls you can put them outside the form, or
> you can even have multiple forms on the page as long as only one has
> runat=3D"server" and they are not nested.
>
> You don't need to put your controls in the

either, you can delete it=
,
> it is just part of the blank page template.
>
> wrote in message
>
> news:6752a7ac-77a8-4fe8-8e3b-851201934704@r9g2000prd.googleg roups.com...
>
>
>
> > We know we need to put inside the element, because the ASP
> > control needs postback.
>
> > If a particular ASP control doesn't need postback, it doesn't really
> > need to be inside the element.
>
> > Now, why there is a
element inside the and it seems to me
> > that everybody is putting their ASP controls in it.
>
> > Thanks in advance.- Hide quoted text -
>
> - Show quoted text -

Putting your controls inside a
element is recomended.
The nice thing about
s is that you can use a StyleSheet!
This makes formating and mantainence very easy.

Steve

Re: ASPNET 2.0 do I need to put everything inside <div>

am 09.04.2008 02:55:50 von ckkwan

Thanks for the info.

If it is just because of CSS, then I think I can afford to do without
it. It is not difficult to add the

later when I really need to
format the entire page with CSS. :)

On Apr 9, 6:01=A0am, S_K wrote:
> On Apr 8, 7:41=A0am, "Aidy" wrote:
>
> Putting your controls inside a
element is recomended.
> The nice thing about
s is that you can use a StyleSheet!
> This makes formating and mantainence very easy.
>
> Steve- Hide quoted text -
>
> - Show quoted text -

Re: ASPNET 2.0 do I need to put everything inside <div>

am 09.04.2008 10:34:49 von Patrice

AFAIK this is a compliance issue. My understanding is that an inline tag
should be inside a container block tag. The form just defones the behvaior
for inner fields and is not considered as a container. Or something
similar...

Try to validate once the tag is removed to see if it sill passes...

--
Patrice


a écrit dans le message de news:
0031ddb0-42cc-4b82-afe5-7e7ced275f22@q24g2000prf.googlegroup s.com...
Thanks for the info.

If it is just because of CSS, then I think I can afford to do without
it. It is not difficult to add the

later when I really need to
format the entire page with CSS. :)

On Apr 9, 6:01 am, S_K wrote:
> On Apr 8, 7:41 am, "Aidy" wrote:
>
> Putting your controls inside a
element is recomended.
> The nice thing about
s is that you can use a StyleSheet!
> This makes formating and mantainence very easy.
>
> Steve- Hide quoted text -
>
> - Show quoted text -

Re: ASPNET 2.0 do I need to put everything inside <div>

am 09.04.2008 13:20:48 von Patrice

I checked the exact reason.

This is because whatever you show must be inside an inline or a block
element. Similarly you can't use
....SomeText... you have to wrap SomeText inside for example a
span or a div....

--
Patrice

"Patrice" a écrit dans le message de news:
eFLwUyhmIHA.484@TK2MSFTNGP06.phx.gbl...
> AFAIK this is a compliance issue. My understanding is that an inline tag
> should be inside a container block tag. The form just defones the behvaior
> for inner fields and is not considered as a container. Or something
> similar...
>
> Try to validate once the tag is removed to see if it sill passes...
>
> --
> Patrice
>
>
> a écrit dans le message de news:
> 0031ddb0-42cc-4b82-afe5-7e7ced275f22@q24g2000prf.googlegroup s.com...
> Thanks for the info.
>
> If it is just because of CSS, then I think I can afford to do without
> it. It is not difficult to add the

later when I really need to
> format the entire page with CSS. :)
>
> On Apr 9, 6:01 am, S_K wrote:
>> On Apr 8, 7:41 am, "Aidy" wrote:
>>
>> Putting your controls inside a
element is recomended.
>> The nice thing about
s is that you can use a StyleSheet!
>> This makes formating and mantainence very easy.
>>
>> Steve- Hide quoted text -
>>
>> - Show quoted text -
>
>