Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating https actionlink

I am working asp.net mvc3. I have an action link like following:

 @Html.ActionLink("Yes", "Admin", "Foo", null, new { @class = "link" })

How can I modify this to create a link in https as oppose to http as I have set my controller action with [RequireHttps]

like image 662
amateur Avatar asked Jun 28 '12 15:06

amateur


People also ask

What is difference between HTML ActionLink and URL action?

There is a difference. Html. ActionLink generates an <a href=".."></a> tag whereas Url. Action returns only an url.


1 Answers

Ever looked at the documentation or the Intellisense that Visual Studio offers you?

@Html.ActionLink(
    "Yes",                     // linkText
    "Admin",                   // actionName
    "Foo",                     // controllerName
    "https",                   // protocol
    null,                      // hostName
    null,                      // fragment
    null,                      // routeValues
    new { @class = "link" }    // htmlAttributes
)
like image 63
Darin Dimitrov Avatar answered Sep 22 '22 11:09

Darin Dimitrov