routevalues

ASP.NET MVC - Is it possible to generate cross-application action links?

Hi, is it possible to generate cross-application action links using the HTML helper class? I have the following (both are separate VS2008 projects): http://mainwebsite/ http://mainwebsite/application I would like to generate a link IN the /mainwebsite/application/ project TO /mainwebsite/. Is this possible? Or should I just hardcod...

ASP.net MVC RouteLink and optional routeValues

I'm trying to figure out how to conditionally set a routeValue which is optional. I have <%= Html.RouteLink("<<<","Products",new { page=(Model.Products.PageIndex) }) %> If a visitor clicks on a "category" I only show products of that category, but if there is no "category" I show all products. These 2 URLs would be valid: /Product...

Url.Action and routeValues inheritance

Suppose I have the following route. routes.MapRoute("SomeRouteName" , "{node}/{action}/{destination}" , new { Controller = "Document"} , new { Action = "Transfer|Destine|Remove" } ); When "/X/Destine/Y" URL is entered, the "Destine" action fires and renders a view, which contains the following: <%= Url.Action("Transfer") ...

Html.ActionLink routeValues

Sorry this is my first question, don't know ho this works and i'm quite new to ASP.NET MVC. My action is: [AcceptVerbs(HttpVerbs.Get)] public ActionResult SearchResults(PersonSearch search, int? page) { // Assign the search results to the View ViewData["Results"] = new PaginatedList<Person>( ...

DateTime constraint on route with time?

Hello How would a constraint for a route look like that needs to be in the format:yyyy-MM-dd hh:mm? especially with the space there? I got @"\d{4}-\d{2}-\d{2}" so far, but not sure about the rest How's it done? /M ...

Retain jquery tab position after Post action in asp.net mvc

I have a page with jquery tabs in which the user can update their Profile, Password, General in each tab. When a user update the details in "General" tab, the post action will be called and it should retain the "General" tab back. It can be accessed directly by calling like http://localhost:8742/User/Settings/10#General. In the url 10...

Pass Dictionary of routeValues to ActionLink

All, Getting to grips with ASP.NET MVC. So far, so good, but this one is a little nuts. I have a view model that contains a dictionary of attributes for a hyperlink, used like this: menu = model variable Html.ActionLink(Html.Encode(menu.Name), Html.Encode(menu.Action), Html.Encode(menu.Controller), menu.Attributes, null) The proble...

Querystring formatting in asp.net MVC 2

Seems like a straitforward question but I can't quite figure it out myself... I have an actionlink like so Html.ActionLink( "Test", "test", new { q = "search+twitter" } ) This produces a url string as follows http://myserver/test?q=search%2Btwitter But i would like to preserve the plus sign (which i assume is being UrlPathEncoded) ...

How to parse a string URL into MVC Route Values (area, controller, action, querystring)?

Is there a method to extract the area, controller, action, and querystring from a URL in ASP.NET MVC? Don't want to reinvent the wheel implementing my own if there's already a way to do it. Thanks! ...

Adding dynamic parameters with Html.BeginForm and jQuery submit

// html <% using (Html.BeginForm("MyAction", "MyController", new { id = ViewContext.RouteData.Values["id"] }, FormMethod.Post, new { enctype = "multipart/form-data", class="myForm" })) { %> <input type="file" name="blah" /> <% } %> // script $container.find('.myButton')....

MVC ActionLink add all (optional) paramters from current url

the very famous actionlink: <%: Html.ActionLink("Back to List", "Index")%> Now, this link is in my Details view. The Index view is a search page. The url of that looks like this: http://localhost:50152/2011-2012/Instelling/Details/76?gemeente=Dendermonde&amp;postcode=92**&amp;gebruikerscode=VVKSO114421&amp;dossiernr=114421%20&amp;o...