Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 11, 2012 01:14 AM by thomas_msn01
Member
17 Points
43 Posts
Nov 10, 2012 09:28 PM|LINK
Hello,
This action link (where I need to define the css class:
@this.Html.ActionLink("Contact","Index","contact/",new{@class="MenuLink"});
Should write a link pointing to
http://[MySite]/contact/
Instead it points to
http://[MySite]/?Length=8
But
@this.Html.ActionLink("Contact","Index","contact/");
works fine, except it doesn't have the css class I ned.
Thank you if you can help me.
All-Star
18720 Points
2899 Posts
Nov 10, 2012 10:19 PM|LINK
It doesn't make sense but if you look at the syntax here your statement requires some change.
I would write like this.
@Html.ActionLink("Contact", "Index", "Contact", null, new {@class = "MenuLink" })
Nov 11, 2012 01:14 AM|LINK
That right, I thought there was a method matching my syntax.
thomas_msn01
Member
17 Points
43 Posts
MVC4 action link generation problem
Nov 10, 2012 09:28 PM|LINK
Hello,
This action link (where I need to define the css class:
@this.Html.ActionLink("Contact","Index","contact/",new{@class="MenuLink"});Should write a link pointing to
Instead it points to
But
@this.Html.ActionLink("Contact","Index","contact/");works fine, except it doesn't have the css class I ned.
Thank you if you can help me.
CPrakash82
All-Star
18720 Points
2899 Posts
Re: MVC4 action link generation problem
Nov 10, 2012 10:19 PM|LINK
It doesn't make sense but if you look at the syntax here your statement requires some change.
I would write like this.
@Html.ActionLink("Contact", "Index", "Contact", null, new {@class = "MenuLink" })
thomas_msn01
Member
17 Points
43 Posts
Re: MVC4 action link generation problem
Nov 11, 2012 01:14 AM|LINK
That right, I thought there was a method matching my syntax.