Asp.Net News
Free Tech Magazines
Asp.Net Web Hosting
Suggest Us
Link to Us
Feeds Subscription
Questions & Answers
Tips & Tricks
 Which attribute of hyperlink can replace *rel* attribute in href??
Posted by Ankur Dagar on  11/13/2009 7:35:38 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
My code is ::

<asp:HyperLink ID="HyperLink1" NavigateUrl="~/images/image-1.jpg" ImageUrl="~/images/thumb-1.jpg" rel="tag" runat="server">HyperLink</asp:HyperLink>

but it creates an warning::

" Validation (ASP.Net): Attribute 'rel' is not a valid attribute of element 'HyperLink' "

So which attribute can i use doing same function (as rel have) in this.

also can i use rel attribute or some other attribute if i am using image button or image??

any one have an ans plzz send ..


Post Your Reply Post New Question

 Viewer's Reply
Add "rel" attributes to Hyperlink from Asp.Net code-behind
Answered By Moderator1 on 11/15/2009 8:20:27 AM

Not all property of a html control is available in the property list of the server controls. Anyhow you can add it from the code-behind as follows,

HyperLink1.Attributes.Add("rel", "tag");

Try this and if you have any related problem with this, please post under the same questions. Thanks.
Post Your Reply If you still have problem, post it again under this reply for better response.

Sponsored by
The Beginner's Guide to Joomla
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - Free 207 Page Preview!
Integrating Silverlight 4 with SharePoint 2010 - Free 42 Page Sample Chapter