I have the following ajax function on my view in a ASP.NET MVC3 website. This function is called from a list in the top of the page, and it works great. But I need another value from the querystring, that needs to be passed to the controller function. How Do i achieve this ?
jQuery function
function ShowDeals(itemNo) {
//get the vendor
var dialogDIV = $('<div></div>');
$.ajax(
{
url: '/Deal/Index',
type: "POST",
data: ({ toets: itemNo }),
dataType:'html',
success: function (result) {
$(dialogDIV).html(result);
$(dialogDIV).dialog({
position : [,100],
error: function (req, status, error) {
alert(error);
}
});
},
error: function (req, status, error) {
alert(error);
}
})
return false;
}
Controller Action
public ActionResult Index(int toets,string vendorNo)
{
string temp = toets.ToString();
string tempdd = Request.QueryString["vendorNo"];
//return Content("1212121212");
return PartialView();
}
The toets parameter is passed from the ajax function, but I now need the vendorNo that is in the Querystring.
Thanks
EDIT : I know I can add a javascript function to get the value from the querystring, but is that the best way to do this ?