FAQ Database Discussion Community


Remove style from an actionlink

c#,css,actionlink
I have an actionlink as such, <td> @Ajax.ActionLink( item.FirstName, "DisplayApplication", new { ID = item.ColleagueID }, new AjaxOptions { UpdateTargetId = "Application" } ) </td> I want this to appear just as normal text does on the rest of my website without the normal styling that a link will have,...

How can I return a model with an ActionLink?

asp.net-mvc-4,model,actionlink
I'm trying to get a model in a view and pass it to another controller but the model is null when passed to the other controller. Controller - Here I send the model to render in my view: [HttpPost] public PartialViewResult Index(ReportesTabularesViewModel ModeloInput) { GetDatosTabularReportInput input = new GetDatosTabularReportInput {...

ASP.NET MVC4 - Different routing for 2 controllers with actionLinks

asp.net-mvc,asp.net-mvc-4,asp.net-mvc-routing,actionlink,html.actionlink
Okay, I've got this case where I have two controllers: HomeController MathController I want the routing for my HomeController to stay as default:{controller}/{action}/{id}. But I want to access the actions in the MathController with http://myurl/Task/Math/{action}. So what I've done is to write my RouteConfig like this: routes.MapRoute( name: "Math", url:...

MVC Routes, adding a filter to existing page

asp.net-mvc,asp.net-mvc-routing,actionlink
I have a route: context.MapRoute( "ISPCCodeSearch_default", "OnlineOrder/{controller}/ISPCCodeSearch/{ISPC}", new { area = "OnlineOrder", controller = "Home", action = "ISPCCodeSearch", ISPC = UrlParameter.Optional, }); that brings up a number of products by a product code eg, OnlineOrder/Home/ISPCCodeSearch/11011/ I want to further filter this by brand by clicking on a filter link on...

Use Ajax actionlink for entire table row

c#,model-view-controller,actionlink
At the moment I am using the following code to display information in a partial view below my table - @foreach (var item in Model) { <tr> <td> @Ajax.ActionLink( item.FirstName, "DisplayApplication", new { ID = item.ColleagueID }, new AjaxOptions { UpdateTargetId = "Application" } ) </td> <td> ... </td> <td>...

Get Column title in View

asp.net-mvc,razor,parameters,title,actionlink
MVC5 did a great job on automatically creating the View page (Razor). It currently displays my list of Students for example with table heading like this: <th> @*@Html.ActionLink("", "Index", new { sortOrder = ViewBag.NameSortParm })*@ @Html.DisplayNameFor(model => model.LastName) </th> Now. DisplayNameFor take a Lambda Expression as its parameter. However, I...

Click actionlink on view, controller checks condition, returns JSON, jQuery Ajax doesn't work

ajax,json,controller,asp.net-mvc-5,actionlink
Click ActionLink on view, controller checks condition, returns JSON, JQuery Ajax doesn't work. Click the "Delete" ActionLink, "Delete" controller if customer's "Orders" property is null, if not null, a message will be popped up. If null, process to "Delete" view. Here are the codes: 1, on the view, the @Html...

ActionLink (LinkText,Action,ControlName,AreaName,RoutesValue,html attribute)

asp.net,asp.net-mvc,routes,actionlink,asp.net-mvc-6
A bottom'd like code samples ActionLink (LinkText,Action,ControlName,AreaName,RoutesValue,html attribute) I looked at the sites do not have all of these together Thanks

MVC4 - ActionLink to either Create() or, if already existing, Edit(Id)

asp.net-mvc,asp.net-mvc-4,actionlink,html.actionlink
I would like an action link that says "set user default". There's a possibility the database does not already have the UserDetails stored for the user who clicks the link. If this is the case, I would like to direct the user to the Create view when they can save...

Hide ActionLinks based on user roles without exposing roles in view

asp.net-mvc,controller,authorization,actionlink
I use the AuthorizeAttribute and roles (Identity). I want to hide ActionLinks based on user roles. I found solutions with HtmlHelpers like this. But I really don't like those solutions because the view must know about the required roles. This means the roles are defined twice: in the controller and...

Is possible to insert HTML.Actionlink inside LI?

javascript,html,asp.net-mvc,html-lists,actionlink
I'm trying to insert a @HTML.ActionLink element inside a li element using the following code: var ul = document.getElementById('container'); var enlace = '@Html.ActionLink("Details", "Details", "Elements", new { id = "5" }, null)'; var li = document.createElement('li'); li.appendChild(document.createTextNode('My title')); li.appendChild(document.createElement('br')); /////////////////////////////////////////////// li.appendChild(document.createElement(enlace)); /////////////////////////////////////////////// ul.appendChild(li); Is it...