html.actionlink

How to generate just the URL of the Controller method in ASP.NET MVC

So Html.ActionLink("Report", "SendMail", "Misc", new { id = Model.ImageID }, null) will generate a nicely formatted link. <a href="http://localhost:3224/Misc/SendMail/5"&gt;Send Mail</a> How can I generate just the URL of the link, short of parsing the output of Html.ActionLink? ...

Html.Encode question

I'm working through the NerdDinner MVC tutorial and came across this and was wondering about. On page 62 of the pdf they have the following: <asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server"> <h2>Upcoming Dinners</h2> <ul> <% foreach (var dinner in Model) { %> <li> <a h...

Using Html.ActionLink and Url.Action(...) from inside Controller

I want to write an HtmlHelper to render an ActionLink with pre-set values, eg. <%=Html.PageLink("Page 1", "page-slug");%> where PageLink is a function that calls ActionLink with a known Action and Controller, eg. "Index" and "Page". Since HtmlHelper and UrlHelper do not exist inside a Controller or class, how do I get the relative UR...

Asp.net Mvc configurable Html.ActionLink controller/method

Hello everybody, I have ascx partial view with html-layout like that <%=Html.ActionLink<PersonController>(x => x.Publications(param1, param2, ... )) %> My ascx is pretty big & I'd like to reuse it, changing controller/method in Html.ActionLink with another controller/method. Method of another controller has the same signature as Per...

How can I store a useful value in my ASP.NET MVC site's URL and make it propagate?

Let's say I have a simple ASP.NET MVC site with two views. The views use the following routes: /Foo and /Foo/Bar. Now let's say I want to use the URL to specify (just for the sake of example) the background color of the site. I want my routes to be, for instance, /Blue/Foo or /Green/Foo/Bar. Also, if I call Html.ActionLink from a view,...

Create a T4MVC ActionLink with hash/pound sign)

Is there a way to create a strongly typed T4MVC ActionLink with a hash in it? For example, here is the link I'd like to create: <a href="/Home/Index#food">Feed me</a> But there's no extension to the T4MVC object that can do this. <%= Html.ActionLink("Feed me", T4MVC.Home.Index()) %> So, what I end up having to do is create an acti...

Possible to write an Extension Method for ASP.NET's Html.ActionLink() method?

Right now, I'm trying to work around an IE6/7 bug which requires the wrapping of the </a> closing tag with this IE specific comment to make some drop-down menu work: <!--[if IE 7]><!--></a><!--<![endif]--> Unfortunately, I cannot inject this directly into my View page code like this: <%= Html.ActionLink("LinkName<!--[if IE 7]><!--></...

Html.ActionLink doesn't work in IE6

<%= Html.ActionLink("Account Page", "Index", new { controller = "Account", culture = (string)Session[culture], client = (string)Session[Client], brand = (string)Session[Brand], storeid = (string)Session[Store] })%> This works in almost all browser (IE7/8, Mozilla, safari, chrome) except IE6. The problem here is the links ar...

Need some help understanding the usage of this Html.ActionLink().

I'm following the NerdDinner ASP.Net MVC tutorial and I have the following line of code: <%= Html.ActionLink("Edit Dinner", "Edit", new { id = Model.DinnerID}) %> | <%= Html.ActionLink("Delete Dinner", "Delete", new { id = Model.DinnerID }) %> What I don't understand is why the third parameter of the ActionLink requires a new ...

asp:Repeater and ActionLink

Am I able to use asp:Repeater and Html.ActionLink together for creating a dynamic menu? Or is there any other methods that I can use it? Note: I'm getting the menu list from SQL. ...

Turining An HTML <td> into a link ASP.NET MVC

I'd like to be able to turn rows of an html table into links to controllers. I figured something like <td onclick="<%:Html.ActionLink("", "Index", new {id=item.user_id}) %>"> I'm using MVC 2 Thanks. ...

Save text and link in asp.net mvc resource file - resource.aspx.resx

i have a sentence with html. action link: <b>Please enter your username and password. <%= Html.ActionLink("Register", "Register", null, new { @id = "logOnLinkRegister" })%> if you don't have an account. </b> how can i save it in resource.aspx.resx file? it is in the asp.net mvc web project. ...

How to call the Route Name in Html.ActionLink asp.net MVC?

I have this route routes.MapRoute( "ViewGames", // Route name "psp/{controller}/{action}", // URL with parameters new { controller = "Games"} // Parameter defaults ); and I used <%= Html.ActionLink("God of War", "godofwar", "Games")%> all though it gives me a link like this somesite.com/psp/...

Call jquey funtion in Html.ActionLink

Hi I am trying to implement a export to csv functionality where when the user clicks on a link, I need to get the selected items ids from Telerik grid and pass it to a controller method which will prepare the csv file pass it back so the user can save the file on local hard disk I have got the controller working where it can prepare the...