views:

128

answers:

1

I'm a little puzzled with QueryStrings and ActionResult

I have a URL coming in from jQuery as:

url: "/ToBePaid/Receipt/" + $(this).attr('value') + "&receipt=" + $(this).attr('checked')

which generates

/ToBePaid/Receipt/28cb8260-d179-450f-b9c4-162f1cc45bbd&receipt=true

and my ActionResult is as follows:

public ActionResult ReceiptExpenseForGrouping(string id, string receipt)

and what I am getting is

id = "28cb8260-d179-450f-b9c4-162f1cc45bbd&receipt=true" receipt = "true" = null

But what I want is

id = "28cb8260-d179-450f-b9c4-162f1cc45bbd" receipt = "true"

Please help me out here someone?

+2  A: 
url: "/ToBePaid/Receipt/" + $(this).attr('value') + "/?receipt=" + $(this).attr('checked')

Should do the trick,

Kindness,

Dan

Daniel Elliott
Many thanks :-)So easy too
Coppermill