473,795 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3579
Two way to do that:

First, you can replace them with server side scripts e.g.: <%=
WebForm1.myvalu e %>

Second, you can place <asp:Literal> or <asp:Placeholde r>control depending on
your need.
I'm sure both method can use HTML code as their value.

"Ed West" <we**@westville .com> ???
news:O$******** ******@TK2MSFTN GP10.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$******** ******@TK2MSFTN GP10.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.myvalu e %>

Second, you can place <asp:Literal> or <asp:Placeholde r>control depending on
your need.
I'm sure both method can use HTML code as their value.

"Ed West" <we**@westville .com> ???
news:O$******** ******@TK2MSFTN GP10.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>
blahblahbla h ...
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.myvalu e %>
Second, you can place <asp:Literal> or <asp:Placeholde r>control
depending on
your need.
I'm sure both method can use HTML code as their value.
"Ed West" <we**@westville .com> ???
news:O$******** ******@TK2MSFTN GP10.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
5664
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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Thanks, CMA
0
2469
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 linked to a level3 etc) all the way up to a level 1
10
1933
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" content="text/html; charset=iso-8859-1" /> <script language="JavaScript" type="text/javascript"> //<!]>
0
1448
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 --------- <asp:placeholder id="phPage" runat="server"></asp:placeholder> ---------
5
10076
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 page). Is there an easy way to do this or do I need to stream the html into my application and parse unwanted header/footer info before rendering it within the application page (as a literal control, i imagine) Has anyone done this or seen any...
2
2212
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 "myHtmlTable" dynamically. For each data row I added an additional column. In the additional column is a textbox called "textbox(rowcount)". In my webpage (.aspx) I have a PlaceHolder (myPH). The generated html table is added to this PlaceHolder:
20
5652
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 client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
1
1795
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. I have tried to insert the control into a placeholder with no joy. I want to have something similar to DotNetNukes way of adding content to a page. Does anyone have any ideas how to do this or where I'm going wrong? What I have so far :...
2
15079
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). Literal consists of standard html code like <table>, <tr>, etc.. Nevertheless Asp Net generates me now table in html code, maybe you see my mistake in the code below. Thanks a lot! _MC_
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.