Vikas
Vikas

Reputation: 24332

add querystring parameter in URL

I am using asp.net mvc.

here I am not asking on controller logic but at view page.And I am not messing with default setting of url routing.

I have a view having some url like /controller/action?CID=2

In this view I want to put Link having above structure but with different controller.

The point is get the current url parameter and put hyperlink with same Querystring parameter.

Upvotes: 0

Views: 1496

Answers (1)

Çağdaş Tekin
Çağdaş Tekin

Reputation: 16661

<%=Html.ActionLink("linkText", "actionName", 
    "controllerName", new {CID = Request.QueryString["CID"]}, null) %>

Do you mean something like this?

Upvotes: 2

Related Questions