The following is the correct overload (in your example you are missing a closing }
to the routeValues
anonymous object so your code will throw an exception):
<a href="<%: Url.Action("GetByList", "Listing", new { name = "John", contact = "calgary, vancouver" }) %>"> <span>People</span> </a>
Assuming you are using the default routes this should generate the following markup:
<a href="/Listing/GetByList?name=John&contact=calgary%2C%20vancouver"> <span>People</span> </a>
which will successfully invoke the GetByList
controller action passing the two parameters:
public ActionResult GetByList(string name, string contact) { ... }
Related Posts:
- How to move div vertically down using CSS
- HTTP Error 503, the service is unavailable
- How to resolve “Server Error in ‘/’ Application” error?
- Chrome returns “Bad Request – Request Too Long” when navigating to local IIS Express
- What does ‘IISReset’ do?
- What does ‘IISReset’ do?
- “Exception has been thrown by the target of an invocation” error (mscorlib)
- ORA-12154 could not resolve the connect identifier specified
- What are .ashx files in an ASP.NET application?
- Is “ ” a replacement of ” “?
- Does PHP supports MVP pattern?
- Server.Transfer Vs. Response.Redirect
- W3WP.EXE using 100% CPU – where to start?
- HTTP Error 403.14 – Forbidden – The Web server is configured to not list the contents of this directory
- Error :The remote server returned an error: (401) Unauthorized
- Exception of type ‘System.OutOfMemoryException’ was thrown.
- Cannot read configuration file due to insufficient permissions
- A potentially dangerous Request.Form value was detected from the client
- Could not load file or assembly ‘Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’
- How to Determine IUSR Password
- ASP.NET Why are sessions timing out, sessionstate timeout set
- WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for ‘jquery’. Please add a ScriptResourceMapping named jquery(case-sensitive)
- What does aspnet_regiis.exe do
- javascript “window.history.forward(1);” not working
- drop down list value in asp.net
- Cannot read configuration file due to insufficient permissions
- Can you recommend a .net template engine?
- How do I resolve “HTTP Error 500.19 – Internal Server Error” on IIS7.0
- Asp.net Hyperlink control equivalent to
- Error ‘2035’ (‘MQRC_NOT_AUTHORIZED’) While Connecting to MQ
- debug=true in web.config = BAD thing?
- What is the difference between ASP.NET and ASP.NET MVC?
- Failed to load resource: the server responded with a status of 401 (Unauthorized) /App/AngularJS/angular.min.js
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- The following sections have been defined but have not been rendered for the layout page “~/Views/Shared/_Layout.cshtml”: “Scripts”
- ASP.NET DateTime Picker
- Could not load file or assembly ‘Microsoft.CodeDom.Providers.DotNetCompilerPlatform
- a page can have only one server-side form tag
- “This operation requires IIS integrated pipeline mode.”
- Could not load file or assembly ‘Microsoft.ReportViewer.WebForms’
- Maximum request length exceeded.
- Could not load file or assembly Exception from HRESULT: 0x80131040
- The localhost page isn’t working. localhost redirected you too many times
- Response Content type as CSV
- Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive
- How to change the text of a label?
- IIS error, Unable to start debugging on the webserver
- How to troubleshoot “System.Web.HttpException (0x80004005): File does not exist”?
- jquery $(this).id return Undefined
- How handle Application Error Exception code: 0xc00000fd
- C# function to return array
- “The transaction log for database is full due to ‘LOG_BACKUP'” in a shared host
- jQuery UI ” $(“#datepicker”).datepicker is not a function”
- Adding a favicon to a static HTML page
- Maximum call stack size exceeded error
- See answer keys in Google Form (quiz) source page?
- CSS Background Opacity [duplicate]
- Google Chrome Uncaught (in promise) DOMException while playing AUDIO
- jQuery.click() vs onClick
- CSS `height: calc(100vh);` Vs `height: 100vh;`
- HTML Width Percentage
- html tables: thead vs th
- What is “X-Content-Type-Options=nosniff”?
- HTML IF Statement
- How to make an input type=button act like a hyperlink and redirect using a get request?
- “.addEventListener is not a function” why does this error occur?
- Textarea Auto height
- How to get current screen width in CSS?
- margin-right is not working with my HTML. How can I center my content?
- Root element is missing
- Scroll to bottom of div?
- vertical-align with Bootstrap 3
- What is the difference between localStorage, sessionStorage, session and cookies?
- Form inside a table
- c# .net change label text
- How do I change the font color in an html table?
- How to scroll to top of page with JavaScript/jQuery?
- CSS: Background image and padding
- How to embed an autoplaying YouTube video in an iframe?
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- Appearance -> Menu -> Menu Structure : Add plain HTML code as an element
- Include chat (HTML, js, css) in all pages of WordPress
- WordPress automatically adding html tag around PHP code
- Converting HTML Template to WordPress Theme
- How Do I Figure Out What File(s) to Edit from Looking at the Source Code [closed]
- How can I fix the redirect chain after implementing ssl on wordpress?
- Showing special sigh (?) in blank space after compress html code
- How to remove ?wp-mce from page source?
- plugin shortcode output
- How to include this jQuery File in wordpress?
- echo custom fields with AJAX
- How to place copyright next to footer menu?
- Removing Unused WP SEO Codes display on html page [duplicate]
- How to create a WP theme that use BootStrap? [closed]
- Confused – can’t access wordpress dashboard or site that has been published
- Access certain Entry in HTML-Table and pass the entry-data in WP not working [closed]
- issues with a slider – investigations with firebug
- Valid WordPress html elements
- How to link and display an “example.php”?
- How do I load a HTML page as WordPress Homepage without adding it in the ‘Pages’ section