Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Can I Put Generic HTML Text in a Placeholder?

 
Thread Tools Search this Thread
Old 08-19-2004, 05:50 AM   #1
Default Can I Put Generic HTML Text in a Placeholder?


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
  Reply With Quote
Old 08-19-2004, 06:21 AM   #2
Lau Lei Cheong
 
Posts: n/a
Default Re: Can I Put Generic HTML Text in a Placeholder?
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 <asplaceholder>control 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





Lau Lei Cheong
  Reply With Quote
Old 08-19-2004, 01:38 PM   #3
Kevin Spencer
 
Posts: n/a
Default Re: Can I Put Generic HTML Text in a Placeholder?
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
  Reply With Quote
Old 08-20-2004, 05:15 AM   #4
Ed West
 
Posts: n/a
Default Re: Can I Put Generic HTML Text in a Placeholder?

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 <asplaceholder>control 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

>
>
>



Ed West
  Reply With Quote
Old 08-20-2004, 05:38 AM   #5
Mark Harris
 
Posts: n/a
Default Re: Can I Put Generic HTML Text in a Placeholder?
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 <asplaceholder>control
>> 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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

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




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46