![]() |
|
|
|||||||
![]() |
ASP Net - Can I Put Generic HTML Text in a Placeholder? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hello
Can I put generic HTML Text in a Placeholder, or does it need to be a server control? If I can't, how can I put dynamically put in some text in a template? ie, in the .ascx file <html> <title><!-- want to put something dynamic here! </title> <body> blahblahblah ... The current logged on user is: <!-- MORE DYNAMIC TEXT HERE --> .. etc . ? thanks, -ed Ed West |
|
|
|
|
#2 |
|
Posts: n/a
|
Two way to do that:
First, you can replace them with server side scripts e.g.: <%= WebForm1.myvalue %> Second, you can place <asp:Literal> or <asp your need. I'm sure both method can use HTML code as their value. "Ed West" <> ??? news:O$ ???... > Hello > > Can I put generic HTML Text in a Placeholder, or does it need to be a > server control? If I can't, how can I put dynamically put in some text > in a template? ie, in the .ascx file > > > <html> > <title><!-- want to put something dynamic here! > </title> > <body> > blahblahblah ... > The current logged on user is: <!-- MORE DYNAMIC TEXT HERE --> > . etc . > > > ? > > thanks, > > -ed Lau Lei Cheong |
|
|
|
#3 |
|
Posts: n/a
|
Hi Ed,
At runtime, all HTML in the Page Template is parsed into LiteralControls, as ASP.Net is purely object-oriented. Therefore, you can certainly create a LiteralControl, put HTML text into it, and add it to the Controls Collection of any Control. -- HTH, Kevin Spencer ..Net Developer Microsoft MVP Big things are made up of lots of little things. "Ed West" <> wrote in message news:O$... > Hello > > Can I put generic HTML Text in a Placeholder, or does it need to be a > server control? If I can't, how can I put dynamically put in some text > in a template? ie, in the .ascx file > > > <html> > <title><!-- want to put something dynamic here! > </title> > <body> > blahblahblah ... > The current logged on user is: <!-- MORE DYNAMIC TEXT HERE --> > . etc . > > > ? > > thanks, > > -ed Kevin Spencer |
|
|
|
#4 |
|
Posts: n/a
|
Thanks for the info... is there a way to populate a <%= someVar %> other than making it a public property? ie, i have in my aspx page <% title %> and in the aspx.cs it public String Title { get { return _htmlTitle; } set { _htmlTitle = value; } } is there a way to set many of vars like this from a function or something? ie, ..aspx page: <%=first_name%> <%=last_name%> <BR> <%address%> etc. etc. etc. does each of those vars need to be a property in the aspx.cs page? thanks -dan Lau Lei Cheong wrote: > Two way to do that: > > First, you can replace them with server side scripts e.g.: <%= > WebForm1.myvalue %> > > Second, you can place <asp:Literal> or <asp > your need. > I'm sure both method can use HTML code as their value. > > "Ed West" <> ??? > news:O$ ???... > >>Hello >> >>Can I put generic HTML Text in a Placeholder, or does it need to be a >>server control? If I can't, how can I put dynamically put in some text >>in a template? ie, in the .ascx file >> >> >><html> >><title><!-- want to put something dynamic here! >></title> >><body> >>blahblahblah ... >>The current logged on user is: <!-- MORE DYNAMIC TEXT HERE --> >>. etc . >> >> >>? >> >>thanks, >> >>-ed > > > Ed West |
|
|
|
#5 |
|
Posts: n/a
|
You could try "protected" rather than "public" but still noet getting you
far, have you tried an <asp:literal ? you can set html for that -- Mark Harris Head Developer GameHost CP On Thu, 19 Aug 2004 21:15:36 -0700, Ed West <> wrote: > > Thanks for the info... is there a way to populate a <%= someVar %> other > than making it a public property? ie, i have in my aspx page > > <% title %> > > and in the aspx.cs it > > public String Title { > get { return _htmlTitle; } > set { _htmlTitle = value; } > } > > is there a way to set many of vars like this from a function or > something? > ie, > > .aspx page: > <%=first_name%> <%=last_name%> <BR> > <%address%> > etc. etc. etc. > > does each of those vars need to be a property in the aspx.cs page? > > > thanks > > -dan > > > > Lau Lei Cheong wrote: > >> Two way to do that: >> First, you can replace them with server side scripts e.g.: <%= >> WebForm1.myvalue %> >> Second, you can place <asp:Literal> or <asp >> depending on >> your need. >> I'm sure both method can use HTML code as their value. >> "Ed West" <> ??? >> news:O$ ???... >> >>> Hello >>> >>> Can I put generic HTML Text in a Placeholder, or does it need to be a >>> server control? If I can't, how can I put dynamically put in some text >>> in a template? ie, in the .ascx file >>> >>> >>> <html> >>> <title><!-- want to put something dynamic here! >>> </title> >>> <body> >>> blahblahblah ... >>> The current logged on user is: <!-- MORE DYNAMIC TEXT HERE --> >>> . etc . >>> >>> >>> ? >>> >>> thanks, >>> >>> -ed Mark Harris |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Put cursor at the end of input text | peace2007 | Software | 1 | 10-17-2007 11:41 AM |
| How To Disable Or Hide EXPLORER TOOLBARS IN HTML PAGES | Corona | Media | 1 | 10-11-2006 02:26 PM |
| Memories on TV 3 and Text | alca11 | Software | 0 | 07-20-2006 09:32 PM |
| SONY DVD RW DW-G120A SOMETIMES FAILS...... | atlantic965 | DVD Video | 0 | 06-18-2006 10:36 PM |
| Burn process failed - help! Log file posted for help troubleshooting | Michael Mason | DVD Video | 1 | 08-16-2004 09:24 PM |