actionlink

How can I create this action link?

I'm having issues creating an ActionLink using Preview 5. All the docs I can find describe the older generic version. I'm constructing links on a list of jobs on the page /jobs. Each job has a guid, and I'd like to construct a link to /jobs/details/{guid} so I can show details about the job. My jobs controller has an Index controller...

ASP.NET MVC Folder Controller Html.ActionLink

I have the following code in my Site.Master page of an almost empty ASP.NET MVC Project. <li> <%= Html.ActionLink("Home", "Index", "Home")%> </li> <li> <%= Html.ActionLink("Feed List", "FeedList", "Home")%> </li> <li> <%= Html.ActionLink("Monitored Feeds", "MonitoredFeeds", "Home")%> </li> <li> <%= Html.ActionLink("Abo...

ASP.NET MVC Ajax.ActionLink with Image

Hi Everyone, is there anyway to have an image act as an ajax actionlink? I can only get it to work using text. Thanks for your help! ...

Using a strongly typed ActionLink when the action method doesn't take a primitive type

Hi, Does anyone know how I could go about doing something like : Html.ActionLink(c => c.SomeAction(new MessageObject { Id = 1 } )) This should output a link with the url of "/Controller/SomeAction/1", pointing at an ActionMethod along the lines of: public Controller : Controller { public ActionResult SomeMethod(MessageObject messag...

ActionLinks doesn't always work in FireFox and Safari

I've been learning the new ASP.NET MVC framwork lately and I've developed a test site for a friend who runs a "light café" in Sweden. The plan is to release it within a week or so after performing some final adjustments and fixing some security issues. Yesterday I published the site to a webhost running IIS 6, so the first thing I had ...

Create an ActionLink with HTML elements in the link text

In an ASP.NET MVC view I'd like to include a link of the form: <a href="blah">Link text <span>with further descriptive text</span></a> Trying to include the element in the linkText field of a call to Html.ActionLink ends up with it being encoded (as would be expected). Are there any recommended ways of achieving this? ...

UrlEncode of link ids with ASP.NET MVC HtmlHelper extension methods

I have actions that take string id parameters that are based on a username which can include characters that require encoding, for instance "user?1" If I use ActionLink() to generate the links, passing the string without encoding, it generates a link like this: http:\\localhost\controller\action\user?1, and the action gets passed "user"...

Html.ActionLink in asp.net MVC object value in wrong format

I have a html.actionlink that i wish to display a link to a members profile page like this: http://somesite.com/members/{username} When use the following markup <%= Html.ActionLink(r.MemberName, "profile", new { MemberName = r.MemberName } )%> I get a link that looks like this: http://somesite.com/members?MemberName={username} What ...

ASP.NET MVC Html.ActionLink result URL - the way of encoding

Hi All, I create an amount of actions in MVC controllers. public ActionResult DoSmth1(string token) public ActionResult DoAnother2(string token) And when I have to call ActionLink.. =Html.ActionLink<SomeController>( x=> x.DoSmth(item.property), item.property) =Html.ActionLink<AnotherController>( x=> x.DoAnother(item.property), item....

ASP.Net MVC RC1 RouteCollection.MapRoute Problem

I have a problem with the RC1 version of ASP.Net MVC. Whenever I add a Route before the "Default" route, the resulting Urls created are for the first Route added. Here is my Routing in Global.asax.cs routes.MapRoute( "product-detailed", "Products/{controller}/{action}/{id}", new { controller = "Produ...

How to repeat the same ASP.NET MVC action again?

I have an action called List that shows the results of a search. It receives parameters through the querystring because they are optional. My method signature looks like this: public ActionResult List(List<int> categoryIDs, string school, int? stateID, int? page) CategoryIDs is a multi-select box and I am doing everything over a GET r...

Does ASP.NET MVC RC has a strongly typed RedirectToAction method already?

Since I have decided to let RC go while staying with Beta for now, I have no way of knowing whether there has been some progress in this area. Who has tried it, are there strongly typed RedirectToAction and maybe ActionLink in RC? (I know there is some extra stuff in Futures assembly, but the question really refers to the main build). ...

Actionlink in MVC RC/Beta from codeplex preview 5

In Preview 5, here are the actionlinks that worked fine: listing is the controller and about is the action <%= Html.ActionLink("About", "About", "Listing" ) %> 2. var values = new RouteValueDictionary(); text and actionname are both strings Html.ActionLink(text, actionName, values); What would I con...

Encode dataview value in ASP.NET MVC Actionlink

I am using the Microsoft Ajax Template DataView to bind values to a template. I can do this and it works as you'd expect: <h3>{{ID}}</h3> <p>{{Address}}</p> However I am trying to build an action link that has the ID in it. <h2><%= Html.ActionLink(Html.AttributeEncode("{{Name}}"), "Index", "Restaurant", new { Id = Html.AttributeEncod...

MVC ActionLink generating different types of links... why?

I'm new to MVC land, and have an app that i'm working on. i have 2 different links with 2 routes in my global which are fairly similiar route 1 routes.MapRoute("Category", "Movies/{category}/{subcategory}", new { controller = "Catalog", action = "Index", category = "", subcategory = "" }); route 2 routes.MapRoute("Movie", "Mov...

Html.ActionLink as a button or an image, not a link

In the latest (RC1) release of ASP.NET MVC, how do I get Html.ActionLink to render as a button or an image instead of as a link? ...

ASP.NET MVC - Pass array object as a route value within Html.ActionLink(...)

I have a method that returns an array (string[]) and I'm trying to pass this array of strings into an Action Link so that it will create a query string similar to: /Controller/Action?str=val1&str=val2&str=val3...etc But when I pass new { str = GetStringArray() } I get the following url: /Controller/Action?str=System.String%5B%5D So...

Issue with Ajax.ActionLink incorrectly rendering links when using htmlAttributes.

Does anyone know of any issues with rendering incorrect querystrings when using htmlAttributes in an Ajax.ActionLink? It seems that if I put even an empty array in for the htmlAttributes, the link gets rendered incorrectly. Here's my code. When I do this (note the new { }): <%= Ajax.ActionLink("Delete", "Delete", "Milestone", new Rou...

asp.net mvc Html.ActionLink() keeping route value I don't want

I have the following ActionLink in my view <%= Html.ActionLink("LinkText", "Action", "Controller"); %> and it creates the following URL http://mywebsite.com/Controller/Action Say I add an ID at the end like so: http://mywebsite.com/Controller/Action/53 and navigate to the page. On this page I have the markup I specified above. Now wh...

$(document).ready in ascx page after ajax callback

I'm having a little problem with this setup here I have a list of .ascx files and they all do different tasks in terms of calculations to the controller itself. So on my .aspx page I click on an Ajax.ActionLink() and this will render that specific .ascx file based on the item I clicked. Within that .ascx are 1-3 events that will fire 2 o...