Re: Why use <%= %> ?
From: Karl Seguin (_at_)
Date: 01/24/05
- Next message: Stefano: "Re: IE printing preferences"
- Previous message: Mythran: "Re: Why use <%= %> ?"
- In reply to: Alan Silver: "Re: Why use <%= %> ?"
- Next in thread: Alan Silver: "Re: Why use <%= %> ?"
- Reply: Alan Silver: "Re: Why use <%= %> ?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 Jan 2005 11:50:52 -0500
There are controls which let you render text or even html inside a tag, but
I don't think there are any that let you define the attributes via
strings...even if they did, it would be the same as using <%= %> as you
wouldn't be able to program against it.
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ "Alan Silver" <alan-silver@nospam.thanx> wrote in message news:VrrOvlSZRS9BFwXa@nospamthankyou.spam... > >Alan: > >You are right, there's almost never a good reason to prefer <%= %> over > >using controls. True <%= %> might be nanoseconds faster, but you pay the > >price (about 10x over) with maintenance and bugs. Hopefully the book was > >just showing that you COULD do it. > > OK, I guessed it wasn't necessary (usually), but it's nice tohave it > confirmed. > > > There might be very odd occasions were > >you want to. Someone recently asked how to create a <base> tag...at ifrst I > >thought just use <base id="x" runat="server" /> and declare it as an > >HtmlGenericControl...but it turns out <base> CAN'T have a closing tag, and > >all server/html controls render a closing tag. I provided the guy with a > >server control which overwrote the closing tag behaviour, but using <%= %> > >might have been an easier solution for him to use...There have been other, > >although I can probably count them on a single hand, occasions... > > OK, forgive the ignorance as I'm *really* new at this, but I think I > read that one of the generic controls just produces pretty much what you > put in, which could be plain text. If I'm right, then can't you use that > instead? Or can't you use a control inside a tag? Just occurred to me as > I'm typing that this might not work. > > Thanks > > -- > Alan Silver > (anything added below this line is nothing to do with me)
- Next message: Stefano: "Re: IE printing preferences"
- Previous message: Mythran: "Re: Why use <%= %> ?"
- In reply to: Alan Silver: "Re: Why use <%= %> ?"
- Next in thread: Alan Silver: "Re: Why use <%= %> ?"
- Reply: Alan Silver: "Re: Why use <%= %> ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|