Hidden fields can create in view, but you can't access them in the controller directly, so you need to pass them as a parameter from client side
Sample:
<input type="hidden" id="txt1" value="@objPI.Id" />
<input type="hidden" id="txt1" value="@objPI.Version" />
<input type="hidden" id="txt2" value="@objPI.FileLocationId" />
Now these values can be passed to controller as
function VP_GetDesign() {
try {
VP_ShowLoading("Show");
var vP1 = jQuery.trim(document.getElementById("txt1").value);
var vP2 = jQuery.trim(document.getElementById("txt2").value);
var d = {
vP1: vP1,
vP2: vP2,
}
AjaxPost('/ViewPlace/GetDesign', d, 'VP_GetDesign_CallBack', 'VP_AjaxError');
}
catch (err) {
VP_ShowLoading("Hide");
alert(err);
}
}
The controller code look's like this
public ActionResult GetDesign(String vP1, String vP2)
{
try
{
//vP1=version; vP2=filelocation
}
catch(Exception ex)
{
throw ex;
}
}
Thanks
SP