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

<a> or Hyperlink?

Hi!
I'd like to know what's the difference between <a runat="server"
href="tmp.aspx"and <Hyperlink NavigateUrl="tmp.aspx"in
VisualStudio2005. What's the better chice?

Thanks

Max
Jun 27 '08 #1
4 2350
Hi,

Not that much... because, when rendered and send to client both
generate almost same markup...

But using hyper link in asp.net gives you more control in code
behind ...
Best of luck

Munna

www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #2
Hello Max
I'd like to know what's the difference between <a runat="server"
href="tmp.aspx"and <Hyperlink NavigateUrl="tmp.aspx"in
VisualStudio2005. What's the better chice?
That depents on what you are want to do.

A <a ... runat="server" /equals to the HtmlAnchor-Control.
That means in key difference, that you dont have any Styling possibilitys
out-of-the-box,
with properties.

Instead, you need to make use of <Control>.Attributes.Add(.... to accomplish
the same.
The second difference is, that the HtmlAnchor-Control doesnt support
Databinding at all.

If you dont need that both features, use an HtmlAnchor, that is faster that
HyperLink-Control.

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Jun 27 '08 #3
As Munna says not that much.

Take a look at the difference between
System.Web.UI.HtmlControls.HtmlAnchor and
System.Web.UI.WebControls.Hyperlink for the details.

http://msdn.microsoft.com/en-us/libr...tmlanchor.aspx
http://msdn.microsoft.com/en-us/libr...yperlink..aspx

I would tend to use HyperLink as a server control and the <atag
when just client side HTML (i.e. no runat="server").

Terry.


On Jun 20, 9:35*am, maz77 <nos...@nospam.comwrote:
Hi!
I'd like to know what's the difference between <a runat="server"
href="tmp.aspx"and <Hyperlink NavigateUrl="tmp.aspx"in
VisualStudio2005. What's the better chice?

Thanks

Max
Jun 27 '08 #4
Using a standard HTML anchor tag is the most performant option for static
content:
<a href='whatever.aspx'>click me</a>

The hyperlink web control is best used when you need to manipulate the
hyperlink dynamically from server side code.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
http://iPhonePlaza.net
"maz77" <no****@nospam.comwrote in message
news:48***********************@reader5.news.tin.it ...
Hi!
I'd like to know what's the difference between <a runat="server"
href="tmp.aspx"and <Hyperlink NavigateUrl="tmp.aspx"in
VisualStudio2005. What's the better chice?

Thanks

Max
Jun 27 '08 #5

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

Similar topics

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...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: JezB | last post by:
I'm binding a DataGrid web-control to data fetched from a database. However some of my data fields contain text that is within <...> characters - I notice that everything between the <> is...
3
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
3
by: Josh Valino | last post by:
Hi, I have a client that has our product and in one of the aspx files, there is code like this: <%= SomePublicProperty %> where the public property returns a string. In the test...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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
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.