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...
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...
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!
...
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...
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 ...
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?
...
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"...
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 ...
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....
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...
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...
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).
...
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...
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...
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...
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?
...
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...
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...
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...
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...