473,386 Members | 1,796 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,386 software developers and data experts.

Add a block of HTML to my asp.net page

TPS
I want to add a block of html to asp.net page.

How can I add the HTML to a certain location on my page.

Thanks.

TPS
Nov 18 '05 #1
5 1299
Create a user control

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
----------------------------------------------------------------------------
------------------------------------
<blatant plug>
Professional .NET for Java Developers with C#- ISBN: 1-861007-91-4
Professional Windows Forms - ISBN: 1861005547
Professional JSP 2nd Edition - ISBN: 1861004958
Professional JSP - ISBN:
1861003625
Beginning JSP Web Development - ISBN: 1861002092
</blatant plug>
----------------------------------------------------------------------------
------------------------------------

"TPS" <tp*@tps.com> wrote in message
news:Oa**************@TK2MSFTNGP11.phx.gbl...
I want to add a block of html to asp.net page.

How can I add the HTML to a certain location on my page.

Thanks.

TPS

Nov 18 '05 #2
At design time or run time?
At design time you could create & use a user control.
At run time you could fill in a placeholder control or maybe a panel.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"TPS" <tp*@tps.com> wrote in message
news:Oa****************@TK2MSFTNGP11.phx.gbl...
I want to add a block of html to asp.net page.

How can I add the HTML to a certain location on my page.

Thanks.

TPS

Nov 18 '05 #3
I've found you can either bind <%# test %> or use the old style <%=
test %> to output html.

<stript>...

public string test = "<p> Hello World </p>";

</stript>
<html> .....
<%= test %>

</html>

"TPS" <tp*@tps.com> wrote in message news:<Oa**************@TK2MSFTNGP11.phx.gbl>...
I want to add a block of html to asp.net page.

How can I add the HTML to a certain location on my page.

Thanks.

TPS

Nov 18 '05 #4
TPS
Thank you all for your suggestions.

It looks like the easiest route is to put the HTML in a Label control.

That is what I did and it seems to work just fine.

Are there any drawbacks to this approach?

Thanks,

TPS

Nov 18 '05 #5
Hi TPS,
Thanks for your followup. I'm glad that you've figured out the proper means
to resolve the issue. As the drawbacks of this means you mentioned, I don't
think there is any obvious or potential problems on it. :) In fact, the
ASP.NET Label control is rendered as a <span> html element to the output.
For example:
such a Label as
<asp:Label id="Label1" runat="server">Label</asp:Label>
will be rendered out as below:
<span id="Label1">Label</span>

So, when you input any html code in an Label, it is equals that you put
some html code in a <span> </span> tag, do you think so?

For more detailed info on the <span> html element, you may view the
following web referernces:

#html tutorials. html span tag
http://www.hypergurl.com/span.html

#Div and Span
http://www.goer.org/HTML/intermediate/div_and_span/

Please check out the preceding items. If you have any further questions,
please feel free to let me know.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6

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

Similar topics

5
by: Steve | last post by:
I just noticed, in IE6, when navagating from one page to another with the same basic layout (centered top graphic, for example), that a page with a <script> block in the <head> shifts the HTML...
1
by: Daniel Déchelotte | last post by:
Hi, This is actually two questions in one: how to have a block just fit the data it contains (see my "table-cell" kludge) and how to have it centered in a larger block? My idea is to have my...
14
by: laurence | last post by:
I am implementing a comprehensive image-map generator utility, so have been studying W3C HTML 4.01 Specification (http://www.w3.org/TR/html4/struct/objects.html#h-13.6) on image maps (among other...
3
by: John Crowley | last post by:
I keep running into this over and over again... I want a block server control that renders a header and footer, and child controls in between. But I don't want a templated control, for the...
4
by: txican | last post by:
the HTML is: ---------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html> <head> <title>foo</title>...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
2
by: morrell | last post by:
I have a request to find out is there an easy way to solve this little poblem. ___________________ | Block 1 | | | | | | |...
4
by: Dave | last post by:
TIA for the help.....this should be easy for a pro....I need the two divs with text to display on the same line at the top of the container..??? <html> <head> <style> body...
15
by: cssExp | last post by:
hello, Rather than going on a wild explanation on what's the the problem, it'll be much quicker and easier if i let you look at it yourself, so I'll post my page source (actual contents taken out,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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.