473,395 Members | 1,999 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.

Anchor <a name=... > tag

Hi,

I would like in runtime to create some sections of the page, and at the
beginning to put some links to these sections.

Lets say I have to provide some details for every city user will visit.
I fetch the cities from the DB, and details for every city. Now I want
to have a page like this:
<p><a href="#Minneapolis">Minneapolis</a></p>
<p><a href="#Seattle">Seattle</a></p>
<p><a href="#Tokio">Tokio</a></p>
<p><a href="#Moscow">Moscow</a></p>

.........

<a name="Minneapolis"></a>
Data for Minneapolis
........

<a name="Seattle"></a>
Data for Seattle
......

etc., etc.
So far, I create a PlaceHolders for both links and detail sections, and
while I iterate my data, I generate the anchor name, and I can add the
links using HyperLink control. But I can not figure out how to add the
anchors in the second PlaceHolder.

I taught to use Literal control, but this looks ugly. Any suggestions?

Thanks

Sunny
Nov 18 '05 #1
8 2243
Sunny wrote:
Hi,

I would like in runtime to create some sections of the page, and at the
beginning to put some links to these sections.

Lets say I have to provide some details for every city user will visit.
I fetch the cities from the DB, and details for every city. Now I want
to have a page like this:
<p><a href="#Minneapolis">Minneapolis</a></p>
<p><a href="#Seattle">Seattle</a></p>
<p><a href="#Tokio">Tokio</a></p>
<p><a href="#Moscow">Moscow</a></p>

........

<a name="Minneapolis"></a>
Data for Minneapolis
.......

<a name="Seattle"></a>
Data for Seattle
.....

etc., etc.
So far, I create a PlaceHolders for both links and detail sections, and
while I iterate my data, I generate the anchor name, and I can add the
links using HyperLink control. But I can not figure out how to add the
anchors in the second PlaceHolder.

I taught to use Literal control, but this looks ugly. Any suggestions?


Use the System.Web.UI.HtmlControls.HtmlAnchor control class.

--
mikeb
Nov 18 '05 #2
Thanks a lot.
It is not in the designer toolbox, and google found only pages with
HyperLink control.

I'll give it a try.

Sunny
Nov 18 '05 #3
Hi Sunny,

Here are some additional reference in the MSDN which may be helpful for
getting closer to the HtmlAnchor control and the entire Html Server
Controls group:

#HtmlAnchor Control
http://msdn.microsoft.com/library/en...lAnchorControl
.asp?frame=true

#HTML Server Controls Hierarchy
http://msdn.microsoft.com/library/en...controlshierar
chy.asp?frame=true

Thanks.

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
Hi Steven,

thanks for the links.

A quick question - is there such a beast like <BR> control?

If I want to add some Literals in a PlaceHolder, every one on a new
line, do I have to add in the Text property the <BR> tag, or there is a
programmatic way?

Thanks

Sunny
Nov 18 '05 #5
Sunny wrote:
Hi Steven,

thanks for the links.

A quick question - is there such a beast like <BR> control?

If I want to add some Literals in a PlaceHolder, every one on a new
line, do I have to add in the Text property the <BR> tag, or there is a
programmatic way?


HtmlGenericControl

--
mikeb
Nov 18 '05 #6
Thanks for the tip.

But HtmlGeneralControl("BR") generates this:

<BR></BR>

which results in 2 linebreaks in the browser.

Sunny

In article <uB**************@TK2MSFTNGP09.phx.gbl>,
ma************@nospam.mailnull.com says...
Sunny wrote:
Hi Steven,

thanks for the links.

A quick question - is there such a beast like <BR> control?

If I want to add some Literals in a PlaceHolder, every one on a new
line, do I have to add in the Text property the <BR> tag, or there is a
programmatic way?


HtmlGenericControl

Nov 18 '05 #7
"Sunny" <su***@newsgroups.nospam> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
Thanks for the tip.

But HtmlGeneralControl("BR") generates this:

<BR></BR>

which results in 2 linebreaks in the browser.


Then perhaps you should surround your lines with a <div>, or else add <p>
tags in between the lines.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #8
Thanks John,

it seems that I should start with HTML at first :)

<p> is not suitable, as it makes a blank line.
The only HTML tag I knew that makes line breaks was <BR>, thanks for the
<div> suggestion, exactly what I needed.

Sunny

In article <eZ**************@TK2MSFTNGP11.phx.gbl>,
jo**************@notcoldmail.com says...
"Sunny" <su***@newsgroups.nospam> wrote in message
news:ec**************@TK2MSFTNGP10.phx.gbl...
Thanks for the tip.

But HtmlGeneralControl("BR") generates this:

<BR></BR>

which results in 2 linebreaks in the browser.


Then perhaps you should surround your lines with a <div>, or else add <p>
tags in between the lines.

Nov 18 '05 #9

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

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
6
by: Michael Hamm | last post by:
Hi, I'm trying to write a <form> whihc will retrieve a Web page on another server. I have (essentially) this: <form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi"> <input...
129
by: Torbjørn Pettersen | last post by:
I've started cleaning up my HTML and implementing CSS. So far I've used FrontPage, but am switching over to DreamWeaver. Reading a bit on W3Schools.com and W3.org I see there are a lot of HTML...
4
by: bengee | last post by:
Hi First off - by the word "anchor" i DON'T mean a link, i.e. <a></a> tags I'm trying to position a <select> box inside a <div>. I can use relative positioning to set where the box should...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.