actionlink

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

How can I pass a Textboxes value to my Ajax.ActionLink?

In my ASP.NET MVC application I want a user to add a value into a textbox and then press my Ajax.ActionLink. I want to do something like this: Ajax.ActionLink("Go", "Action", "Controller", new { value = textbox1.value }) Or how else can I get this textbox value back to my action? Jquery? ...

ASP.NET MVC - How to get Ajax 'onclick' for a specific action (I need for Ajax.ActionLink what Url.RouteUrl does for Html.ActionLink)

Hi, REVISION I want add a onclick to a element that handles a Ajax request, not just a route-redirect. I have these options for a route-url. Html.ActionLink(params) Url.RouteUrl(params) 'returns JUST ActionUrl So I can go like <div onclick="javascript:location.href('<%=Url.RouteUrl(params)%>')"></div> But how do I generate t...

ASP.NET MVC Ajax - Is it possible to execute a -GENERATED- Ajax link with keyboard input?

Is anybody able to -execute- a generated Ajax.ActionLink when a user presses a key on the keyboard? (This is needed for accessibility) NOTE: I'm using ASP.NET MVC + Microsoft Js libraries (...Ajax.js / ...MvcAjax.js) + jQuery Javascript to capture keypress (IE + Firefox) $(document).keypress(function(event) { if(event.keyCode == 2...

ASP.Net MVC AJAX link not working

I have this link, in an effort to implement AJAX log on, on my page: <%= Ajax.ActionLink("Log On", "LogOn", "Account", new AjaxOptions { UpdateTargetId = "lll", Confirm = "blah"}) %> There's a div with id lll nearby. When I click the link, I get the blah confirmation (just added for debugging purposes, the behavior without it ...

How to dynamically alter the class of an Html.ActionLink in MVC

I'm looking for a way to alter the class of an ActionLink in the controller based on specific criteria (not found in the model so I can't write a conditional in the view itself). But i can't seem to find the ViewData("name") that allows me to work w/ this element (I assume this is possible, but I'm missing something). I have an html he...

Html.ActionLink problems

I am trying to provide a link to filter search results. <%= Html.ActionLink("Filter Results", "Index", new { page = Model.RestaurantList.PageIndex(), searchText = Model.SearchText, useFilter = true, filterOption = Model.FilterOption, filterText = Model.FilterText }, null)%> The controller definition is as such public ActionResul...

ASP.net MVC site.master link using HTML.ActionLink

I have the following code in my site.master for a menu: <ul id="menu"> <li><%= Html.ActionLink("My Contact Info", "DetailsbyUserName/" + Html.Encode(Page.User.Identity.Name), "Users")%></li> </ul> When I hover over the URL I see that it points to: http://site/Users/DetailbyUserName/[name] which is correct. The iss...

How is OnSuccess measured for a ASP.NET MVC ActionLink?

I don't exactly understand how ASP.NETs ActionLinks work. I see that they have a event handler for OnSuccess and OnFailure, but I can't find anything that describes how success and failure is determined. I'm building an ASP.NET MVC application and within it I have a Ajax.ActionLink that allows me to "vote" on items using AJAX...similia...

how do you add a NEW LINE character in the string portion of an ActionLink?

I'm building a Ajax.ActionLink in C# which starts: <%= Ajax.ActionLink("f lastname", ...more stuff and I'd like there to be a new line character between the words "f" and "lastname". How can I accomplish this? I thought the special character was \n but that doesn't work, and <br> doesn't work either. ...

ASP.NET MVC Ajax: How to update an Ajax.ActionLink itself on-click

I have a page that displays a list with a of elements with a large number of elements, each of which has a boolean property, representing an Enabled and a Disabled state. I need to provide the user with a link for each list item, and the link text must show the opposite status (so if the item is enabled, the link text must display 'Disa...

How to stop Ajax.ActionLink inside jQuery tree item from propagating click to tree item.

Normally, as I understand, you return false from jQuery click handler, and that stops click from going further. How would I achive the same behavior with Ajax.ActionLink? Tree items use click to expand and collaps, and clicking on Ajax.ActionLink causes both action link to be executed and tree item collapsed/expanded. ...

asp.net mvc: How to image map?

How in ASP.NET MVC would I construct an image map? For ref: <map id='headerMap'> <area shape='rect' href="Default.aspx" coords='300,18,673,109' /> </map> One answer of an answer of an unrelated question by markus is something similar: <a href="<%= Url.RouteUrl("MyRoute", new { param1 = "bla", param2 = 5 }) %>"> put in <span>w...

html.actionlink

hi everyone.. i'm just starting to use asp.net mvc.. since i'm not familiar with it, i just want to ask a question about actionlink html helper.. i have this code in my index.aspx home view.. <% Dim _news As datatable = ViewData.Model%> <% For count As Integer = 0 To _news.Rows.Count - 1%> <% Dim id As Integer = _news.Ro...

html.ActionLink links not returning expected value?

I have the following ActionLink Html.ActionLink("Home", "Index", "Home", New With {.class = "tab"}) But it creates the following Link in the address bar http://localhost:1028/?Length=4 as opposed to what I expect it to be as http://localhost:1028/Home. Have I done something wrong to cause this? ...

skip or disable links to current path in ASP.NET MVC

I'm writing an helper that basically receives many RouteValueDictionary and returns many links; I'd like to skip links to the current route values (example: in /Products/Details/3 there should not be a link to /Products/Details/3), ignoring other URL params if any. What I can think of is to check if: destination action and controller ...

How to get an ActionLink to append an / to the end of a link

Hi, My question is simple, how to get an ActionLink to append an / to the end of a link. For some reason our SEO team seem to think this is useful? (anyone? why?) currently ActionLink renders the link as More about vouchers but they would like it to be More about vouchers. Does anyone know how to easily do this without constructing my o...

Why do ActionLinks not show up in the design view?

Is there any reason why ActionLinks aren't rendered by the VWD 2008 design view? ...

How to get formcollection using ajax.actionlink

I have a controller with the codes like this: [AcceptVerbs("POST")] public ActionResult Create(FormCollection collection) { //why is that the collection is null? } I am calling this action using the ajax.actionlink. my problem is the collection is null, unlike if i use the submit(input) button the formcollection has values. ...

need help with mvc & routes

I'm very new to MVC and I'm trying to get a new site set up using it. For SEO reasons we need to make the url of a page something like "Recruiter/4359/John_Smith" or basically {controller}/{id}/{name}. I have that working when I create the url in the code behind like so... //r is a recruiter object that is part of the results for the ...