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”
- Is HTML considered a programming language? [closed]
- Open source social media icons to download and use on website? [closed]
- How to make a monopoly board using css grid?
- Convert HTML to PDF in .NET
- How to add a browser tab icon (favicon) for a website?
- Redirect from an HTML page
- Redirect from an HTML page
- What is ' and why does Google search replace it with apostrophe?
- What’s the difference between ” ” and ” “?
- navigate back with PHP form submission
- Should I use tag for icons instead of ? [closed]
- How am I supposed to use index.html?
- Open link in new tab or window [duplicate]
- Half circle with CSS (border, outline only)
- Line break in HTML with ‘\n’
- CSS calc width and height values
- Web scraping redoc web api
- Failed to load resource: the server responded with a status of 404 (Not Found)
- What is & used for
- HTML encoding issues – “” character showing up instead of ” “
- C# HttpClient An existing connection was forcibly closed by the remote host
- How to horizontally center an element
- Center image using text-align center?
- Unblur content inside blurring background div
- Adding a favicon to a static HTML page
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Failed to load resource: the server responded with a status of 404 (Not Found) css
- Maximum call stack size exceeded error
- How to properly use jsPDF library
- How do I link a JavaScript file to a HTML file?
- Edit webpage with javascript trick – how to “unedit”?
- Can I use complex HTML with Twitter Bootstrap’s Tooltip?
- See answer keys in Google Form (quiz) source page?
- CSS Background Opacity [duplicate]
- Angular, image not found (GET 404)
- How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()
- what do
- CSS Background Opacity [duplicate]
- reCAPTCHA ERROR: Invalid domain for site key
- Google Chrome Uncaught (in promise) DOMException while playing AUDIO
- Making a
- Android WebView err_unknown_url_scheme
- How to make a word underline in Markdown
- The wait operation timed out. ASP
- Customize icon for “Add to home screen”
- The wait operation timed out. ASP
- How to create an HTML button that acts like a link