---
title: "pass query string parameter in ActionLink in MVC"  
description: "pass query string parameter in ActionLink in MVC"  
author: "Anonymous User"  
published: 2014-10-17  
updated: 2014-10-17  
canonical: https://www.mindstick.com/forum/2404/pass-query-string-parameter-in-actionlink-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc", "mvc4"]  
reading_time: 1 minute  

---

# pass query string parameter in ActionLink in MVC

I am having following [action](https://www.mindstick.com/forum/155752/what-is-action-result-with-its-types) [link](https://www.mindstick.com/articles/23633/link-builder):

```
   <%= Html.ActionLink("Check this", "Edit", "test", new { id = id}, new { style = "display:block" })%>
```

\
How to include "[data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science)=[name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide)" as [query string](https://www.mindstick.com/articles/512/query-string-in-asp-dot-net). Some thing like link?data=name

## Replies

### Reply by Norman Reedus

4th parameter of Html.ActionLink can have any number od properties:

```
   <%= Html.ActionLink("Check this", "Edit", "test",     new { id = id, data=name }, new { style = "display:block" })%>
```

\
Theese properties are inserted into URL based on routing, but if the property name cannot be matched into any route it is added as URL GET parameter. So if you have standard route "{controller}/{action}/{id}", you will get the URL test/Edit/[id]?data=[name] from the above code.


---

Original Source: https://www.mindstick.com/forum/2404/pass-query-string-parameter-in-actionlink-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
