473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
Nov 18 '05 #1
4 3552
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:Placeholder>control depending on
your need.
I'm sure both method can use HTML code as their value.

"Ed West" <we**@westville.com> ???
news:O$**************@TK2MSFTNGP10.phx.gbl ???...
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

Nov 18 '05 #2
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" <we**@westville.com> wrote in message
news:O$**************@TK2MSFTNGP10.phx.gbl...
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

Nov 18 '05 #3

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:Placeholder>control depending on
your need.
I'm sure both method can use HTML code as their value.

"Ed West" <we**@westville.com> ???
news:O$**************@TK2MSFTNGP10.phx.gbl ???...
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


Nov 18 '05 #4
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 <we**@westville.com> 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:Placeholder>control
depending on
your need.
I'm sure both method can use HTML code as their value.
"Ed West" <we**@westville.com> ???
news:O$**************@TK2MSFTNGP10.phx.gbl ???...
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

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

87
by: CMAR | last post by:
For xhtml validatin, which is the right metatag to use for English language or can one forget about this tag? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta...
0
by: CoreyMas | last post by:
Hello everyone, I am in a bit of a dilema trying to write an HTML <br> tag into a panel or placeholder. Here is the situation I have 4 tables that represent 4 levels of data (level4 is...
10
by: Andrew Poulos | last post by:
While this works on IE 6: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>aiff</title> <meta http-equiv="Content-Type"...
0
by: Steven | last post by:
From a fairly good understanding of traditional ASP I am taking my first tentative steps into C#. Within Visual Studio, my first test is as follows: Default.aspx contains a placeholder...
5
by: Earl Teigrob | last post by:
I am creating an application where I would like to give web designers the ablity to create a static html page and dyanamically load it into my application(exactly like loading a user control into a...
2
by: Michael Meckelein | last post by:
Environment: VS.NET 2003 Application: ASP.NET web application Program language: C# (Csharp) Situation: I get some information from a sql database. With this information I generate a html table...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
1
by: John | last post by:
I am trying to get a control to insert into the HTML content for a page which comes from our database. At the point I have a tag for the component I want to add which is contained inside the HTML....
2
by: _MC_ | last post by:
Hi, i want to structure two elements (each conists of 1 Label and 1 Textbox) in an Table. As I use an Content Place Holder, i thought it is possible to add the table via Controls.add(Literal)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.