Home All Groups Group Topic Archive Search About
Author
9 Jul 2009 3:01 AM
AAaron123
Someone spent much time helping me with this and I thought I understood but
now find I'm not sure abut some things.



I'd appreciate it if you would comment on all or some of the following.



MUST DO IT THIS WAY

<asp:CheckBox  Checked='<%# Bind("IsPublic") %>'...

OR COULD DO THIS

<asp:CheckBox  Checked="<%# Bind('IsPublic') %>"...

WHICH IS BETTER?



THESE ARE OK??

<input type="button"  onclick="window.location.href = 'UserInfo.aspx'"...

<input type="button"  onclick="window.location='<%=FromWhoPhoto%>';" ...

RUNAT SERVER NOT REQUIRED BECAUSE OF <%=   ?

RUNAT SERVER SEEMS TO BE IMPLIED (these works ok)

SAME FOR <%#   ?



THIS IS OK (seems to work)

onclick="window.location.href='<%# "Events_edit.aspx?Action=Delete&id=" &
truncate(Eval("id")) %>'" />

BUT THIS IS NOT OK

text="some-text-here  '<%#truncate(Eval("id")) %>'" />

Author
9 Jul 2009 9:45 AM
Mark Rae [MVP]
"AAaron123" <aaaron***@roadrunner.com> wrote in message
news:%23t2YGGEAKHA.4376@TK2MSFTNGP04.phx.gbl...

> <asp:CheckBox  Checked='<%# Bind("IsPublic") %>'...
> <asp:CheckBox  Checked="<%# Bind('IsPublic') %>"...
>
> WHICH IS BETTER?

Neither is better. Sometimes single quotes are needed because of other
strings / double quotes in the markup.


> RUNAT SERVER NOT REQUIRED BECAUSE OF <%=   ?

runat="server" tells ASP.NET makes the control available server-side. It's
required for WebControls, optional for HtmlControls. The <%...%> syntax
tells ASP.NET to run whatever it finds between the two delimiters
server-side - the HtmlControl itself doesn't need to be run server-side for
this. It's normally used to inject text into a control's markup.

BTW, posting in all upper case is considered bad netiquette BECAUSE IT LOOKS
LIKE YOU'RE SHOUTING!!!!!


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Are all your drivers up to date? click for free checkup

Author
9 Jul 2009 1:00 PM
AAaron123
Show quote Hide quote
"Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message
news:OrYO%23nHAKHA.4432@TK2MSFTNGP05.phx.gbl...
> "AAaron123" <aaaron***@roadrunner.com> wrote in message
> news:%23t2YGGEAKHA.4376@TK2MSFTNGP04.phx.gbl...
>
>> <asp:CheckBox  Checked='<%# Bind("IsPublic") %>'...
>> <asp:CheckBox  Checked="<%# Bind('IsPublic') %>"...
>>
>> WHICH IS BETTER?
>
> Neither is better. Sometimes single quotes are needed because of other
> strings / double quotes in the markup.
>
>
>> RUNAT SERVER NOT REQUIRED BECAUSE OF <%=   ?
>
> runat="server" tells ASP.NET makes the control available server-side. It's
> required for WebControls, optional for HtmlControls. The <%...%> syntax
> tells ASP.NET to run whatever it finds between the two delimiters
> server-side - the HtmlControl itself doesn't need to be run server-side
> for this. It's normally used to inject text into a control's markup.
>
> BTW, posting in all upper case is considered bad netiquette BECAUSE IT
> LOOKS LIKE YOU'RE SHOUTING!!!!!
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



I used the upper case to try to make it easier to separate my questions from
the markup.

I agree it does look like shouting.

Is it still better to use plain text rather than HTML format (which would
enable other options)?

Thanks
Author
9 Jul 2009 1:46 PM
Mark Rae [MVP]
"AAaron123" <aaaron***@roadrunner.com> wrote in message
news:eAeyIVJAKHA.528@TK2MSFTNGP03.phx.gbl...

> Is it still better to use plain text rather than HTML format (which would
> enable other options)?


Many people have their newsreader configured to filter out HTML posts, and
also posts containing binary attachments...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
9 Jul 2009 4:21 PM
AAaron123
Show quote Hide quote
"Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message
news:%23SMmZuJAKHA.4336@TK2MSFTNGP04.phx.gbl...
> "AAaron123" <aaaron***@roadrunner.com> wrote in message
> news:eAeyIVJAKHA.528@TK2MSFTNGP03.phx.gbl...
>
>> Is it still better to use plain text rather than HTML format (which would
>> enable other options)?
>
>
> Many people have their newsreader configured to filter out HTML posts, and
> also posts containing binary attachments...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
Is this OK? I think I was told that it is not (I may have misunderstood)
but, if ASP.NET simply runs the functions an places the resultant string
there, it looks like it should be OK.
text="some-text-here  '<%#truncate(Eval("id")) %>'" />

Thanks a lot
Author
9 Jul 2009 4:26 PM
Mark Rae [MVP]
"AAaron123" <aaaron***@roadrunner.com> wrote in message
news:%23K7bGFLAKHA.4608@TK2MSFTNGP02.phx.gbl...

> Is this OK? I think I was told that it is not (I may have misunderstood)
> but, if ASP.NET simply runs the functions and places the resultant string
> there, it looks like it should be OK.
> text="some-text-here  '<%#truncate(Eval("id")) %>'" />


It looks OK...

What happened when you tried it...?


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Author
9 Jul 2009 5:22 PM
AAaron123
Show quote Hide quote
"Mark Rae [MVP]" <mark@markNOSPAMrae.net> wrote in message
news:ezVdMILAKHA.3432@TK2MSFTNGP02.phx.gbl...
> "AAaron123" <aaaron***@roadrunner.com> wrote in message
> news:%23K7bGFLAKHA.4608@TK2MSFTNGP02.phx.gbl...
>
>> Is this OK? I think I was told that it is not (I may have misunderstood)
>> but, if ASP.NET simply runs the functions and places the resultant string
>> there, it looks like it should be OK.
>> text="some-text-here  '<%#truncate(Eval("id")) %>'" />
>
>
> It looks OK...
>
> What happened when you tried it...?
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net

I don't remember - it was a while ago and I had problems that may or may not
have be related to this.
Anyway, I was told (as I understood it at the time) not to do it.
If it is not violating some rule I'll try it again.
I'm also collecting facts from the Internet but they are all bits and
pieces.
No comprehensive set of rules.

Thanks

Bookmark and Share