actionlink

ActionLink behaving odd in ASP.Net MVC 2 Preview 2

This action link: <%=Html.ActionLink("About","About", "Home" ,new { @class="menulink" }) %> Produces the following href 'About?Length=4' so it works in the 'root' of the application, but does not once you go one level or more deeper. Also...why is the '?Length=4' being appended? Lol. ...

Ajax.ActionLink lost my JavaScript !

Here's my situation. I have a div on my home page that I use to do a Html.RenderPartial(PartialView). Initially PartialView1 is rendered in this div properly and I can access javascript in the PartialView1.ascx file. So far so good. I also have an Ajax.ActionLink that has the InsertionMode=InsertionMode.Replace. When the Ajax.ActionLi...

ActionLink works locally but doesn't work with Host server. (Host4Life)

So I have this in my Site.Master <%= Html.ActionLink("ABOUT ME", "About", "Home")%></li> Going to AlainaChorney.com (My girlfriends soon to be site) loads up but then clicking the ABOUT ME link dies, and says the file/page isn't there. I've checked the file structure and it is there on the host. When I hover over the link it points...

for loop statement outputs that links to differnent controllers in asp.net mvc

i have a looping statement in in my homepage for news.. I have these codes.. Model : Imports Microsoft.VisualBasic Imports System.Data Public Class ClassNewsConnection Inherits ClassConnection 'Featured News for Home Page Public Function NewsFeatureHome() As DataTable Return ReadData("SELECT * FROM news WHERE n...

Is there a way to make HTML.ActionLink Invisible by default?

I am trying to hide HTML.ActionLink by default when page first renders and then control it's visiblity based on the page the the user is on. Any suggestions? Thanks! ...

Asp.Net MVC Html.ActionLink and Rails link_to. :method equivilent for ActionLink?

Rails link_to allows one to pass in :method for post and delete action verbs. Is there an exention ou there for Asp.Net MVC that does the same sort of thing? I saw something close on haacked that was for deleting. I could use something similar. ...

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>( ...

How Can I Stop ASP.Net MVC Html.ActionLink From Using Existing Route Values?

The website I'm working on has some fairly complicated routing structures and we're experiencing some difficulties working with the routing engine to build URLs the way we need them to be built. We have a search results page that uses RegEx based pattern matching to group several variables into a single route segment (i.e. "www.host.com...

URL-encode parameters in ActionLink?

Hi, I have the following route registered; routes.MapRoute( "LocationsByArea", "Locations/{system}/{storage}/{area}", new { controller = "StorageLocation", action = "Index" }, null ); ...and the following code in my...

asp.net mvc: Paging - Setting Prev/Next page values in ActionLinks?

I'm trying to implement some simple paging, based on http://stackoverflow.com/questions/446196/how-do-i-do-pagination-in-asp-net-mvc The paging works fine. However, I'm now trying to create previous and next links, but can't figure out how to access the params: My route looks like: routes.MapRoute( "Name", "Controller/A...

Ajax.Actionlink output with id attribute

Hi everyone, I'm using the Ajax.Actionlink from the MVC framework and everything works fine with my targets and partial views. However I've seen that the html output doesn't add the "id" attribute to the resulting tag. Is there any way how I can add it? Thanks in advance ...

Why does RouteLink generate friendly URL while ActionLink does not?

Hi there. I have a question regarding RouteLink vs. ActionLink. Consider the following route routes.MapRoute("Routename1", "{someEnum}/SpecificAction/{id}/{stringId}", new { controller = "MyController", id = (int?)null, stringId= (string)null, action = "SpecificAction" }, new { someEnum= "(EnumVal1|EnumVal2)" } ); The we...

ASP.NET MVC: Putting HTML inside Html.ActionLink(), plus No Link Text?

I have two questions: I'm wondering how I can display no link text when using Html.ActionLink() in an MVC view (actually, this is Site.Master). There is not an overloaded version that does not allow link text, and when I try passing in just a blank string, the compiler tells me it needs a non-empty string. How can I fix this? I ...

MVC2: How can I read control values for an action link?

I'm passing in some model information to an ActionLink, but I'd also like to provide the action with the values of some inputs on the page. For example, if I had something like this: <input Name="MyInput" /> <%: Html.ActionLink("MyAction", "MyController", Model.Value); I'd like the action to be aware of both Model.Value (which is pas...

ASP.NET MVC ActionLink and post method

Can anyone tell me how can I submit values to Controller using ActionLink and POST method? I don't want to use buttons. I guess it has something with jquery. Thank you! ...

Asp.net mvc routing : ActionLink return an url with parameters in querystring

Helo, I try to have an URL like this /Forum/Index/2 for url I have a route {controller}/{action}/{page} in my global.asax If i test the above url with the Route Debugger it corresponds to the above route ( and some other but this is the fist one in the list ) but if I create an url with the ActionLink ( like this : <%= Html.ActionLi...

Adding rel and title to ASP.NET MVC Action Links

I decided primarily for SEO reasons to add the "rel" to my action link, but am not sure that the way I have gone about this is going to follow "best practices." I simply created a new Extension method as shown below. Is this the best way to go about doing this? Are there things that should be modified in this approach? VIEW <%= H...

ASP.NET MVC ActionLink: Strange URL generated

Why does the following Html.ActionLink call: Html.ActionLink("Approve", "Advance", new { id = Model.ID, step = StepType.Approve }) generate a URL with query parameters rather than a "restful" URL, i.e.: http://localhost/Website/Case/Advance/1?step=Refer I only have the default route registered, do I need additional routes that can ...

MVC Html.ActionLink ignores the Controller parameter

I have a a view that has the following code: <h2><%= Model.Company.CompanyName %></h2> <h3>Projects</h3> <ul> <% foreach (Project p in Model.Company.Projects) { %> <li><%= Html.ActionLink(p.ProjectName,"Details", "Projects", new {id=p.ProjectID,companyId=p.CompanyID}) %></li> <% } %> </ul> <%= H...

Should Html.Encode be called when building ActionLinks in ASP.NET MVC

If the name of a link is pulled from the database, should you be calling the Html.Encode method to clean the name? For example: Html.ActionLink(Model.PersonFromDB.FirstName, "Action", "Controller", new RouteValueDictionary { { "id", Model.PersonFromDB.Id } }, null) or: ...