Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 18, 2012 08:06 PM by len5134x
Member
20 Points
9 Posts
Mar 06, 2011 06:46 PM|LINK
In keeping with the SEO friendly nature of MVC, shouldn't there be a way to designate the 'title' attribute when building an ActionLink?
All-Star
135148 Points
21679 Posts
Moderator
MVP
Mar 06, 2011 06:53 PM|LINK
<a href= @Url>action(...) title= ,,,>aaa</a>
@Html.ActionLink("name","action" ,new{ title=...})
Participant
922 Points
148 Posts
Mar 07, 2011 01:00 AM|LINK
You can give something like
<%= Html.ActionLink("Link Text", "Action Name", null, new { @title = "Your Title" })%>
If you have any route values, you give
<%= Html.ActionLink("Link Text", "Action Name", new { id = 1 }, new { @title = "Your Title" })%>
Mar 08, 2011 03:08 AM|LINK
Hi thanks for the response. I am not sure I explained myself but what I am looking for is this type of effect
<a href="" title="show this on hover">Hello World</a>
So with the action link I need to have the text display on hover.
I tried your solution but it doesn't seem to work.
I am using MVC3
Thanks for the info tho
24675 Points
4250 Posts
Mar 08, 2011 03:11 AM|LINK
You need to use jQuery to achieve that
Mar 08, 2011 03:20 AM|LINK
Could you post the code which you have tried?
Mar 08, 2011 03:47 AM|LINK
Sorry this works
@Html.ActionLink(item.vch_masterGroup, "Details", new { id = item.i_foomasgro_id }, new { @title = "test" })
I may have been the I had the output cache attribute on so it wasn't re-rendering properly
4 Points
2 Posts
Aug 18, 2012 08:06 PM|LINK
In MVC 3, if you have an ActionLink that has no id field, simple use:
Html.ActionLink("Create New Program", "DefClientTypeCreate", new {}, new {@title="yourtexthere" })
Notice that the third parameter is empty. This acts as a null place holder to the id field.
pcapozzi
Member
20 Points
9 Posts
Ttitle attribute in rendering link with Html.ActionLink
Mar 06, 2011 06:46 PM|LINK
In keeping with the SEO friendly nature of MVC, shouldn't there be a way to designate the 'title' attribute when building an ActionLink?
ignatandrei
All-Star
135148 Points
21679 Posts
Moderator
MVP
Re: Ttitle attribute in rendering link with Html.ActionLink
Mar 06, 2011 06:53 PM|LINK
<a href= @Url>action(...) title= ,,,>aaa</a>
@Html.ActionLink("name","action" ,new{ title=...})
SreejithGopi...
Participant
922 Points
148 Posts
Re: Ttitle attribute in rendering link with Html.ActionLink
Mar 07, 2011 01:00 AM|LINK
You can give something like
<%= Html.ActionLink("Link Text", "Action Name", null, new { @title = "Your Title" })%>If you have any route values, you give
<%= Html.ActionLink("Link Text", "Action Name", new { id = 1 }, new { @title = "Your Title" })%>pcapozzi
Member
20 Points
9 Posts
Re: Ttitle attribute in rendering link with Html.ActionLink
Mar 08, 2011 03:08 AM|LINK
Hi thanks for the response. I am not sure I explained myself but what I am looking for is this type of effect
<a href="" title="show this on hover">Hello World</a>
So with the action link I need to have the text display on hover.
I tried your solution but it doesn't seem to work.
I am using MVC3
Thanks for the info tho
raduenuca
All-Star
24675 Points
4250 Posts
Re: Ttitle attribute in rendering link with Html.ActionLink
Mar 08, 2011 03:11 AM|LINK
You need to use jQuery to achieve that
Radu Enuca | Blog
SreejithGopi...
Participant
922 Points
148 Posts
Re: Ttitle attribute in rendering link with Html.ActionLink
Mar 08, 2011 03:20 AM|LINK
Could you post the code which you have tried?
pcapozzi
Member
20 Points
9 Posts
Re: Ttitle attribute in rendering link with Html.ActionLink
Mar 08, 2011 03:47 AM|LINK
Sorry this works
@Html.ActionLink(item.vch_masterGroup, "Details", new { id = item.i_foomasgro_id }, new { @title = "test" })
I may have been the I had the output cache attribute on so it wasn't re-rendering properly
len5134x
Member
4 Points
2 Posts
Re: Ttitle attribute in rendering link with Html.ActionLink
Aug 18, 2012 08:06 PM|LINK
In MVC 3, if you have an ActionLink that has no id field, simple use:
Html.ActionLink("Create New Program", "DefClientTypeCreate", new {}, new {@title="yourtexthere" })
Notice that the third parameter is empty. This acts as a null place holder to the id field.