asp.net mvc - ActionLink with parameters not working? -
i trying call action result parameters show null?
here actionlink:
@html.actionlink("add", "apnewquote", "apquotes", new {oenum = model.oenumber, quotenumber = model.quotenumber, claimnumber = model.claimnumber, motorbodyrepairer = model.motorbodyrepairer, vehicleregistration = model.vehicleregistration, vehiclemakeid = model.vehiclemakeid, vehiclemodelid = model.vehiclemodelid, vehiclerangeid = model.vehiclerangeid}, new { @class = "btn btn-primary nicebutton" })
and in controller:
public actionresult apnewquote(string oenum, string quotenumber, string claimnumber, string motorbodyrepairer, string vehicleregistration, int? vehiclemakeid, int? vehiclemodelid, int? vehiclerangeid) { //do things variables passed in apnewquoteviewmodel viewmodel = new apnewquoteviewmodel { oenumber = oenumber, quotenumber = quotenumber, claimnumber = claimnumber, motorbodyrepairer = motorbodyrepairer, vehicleregistration = vehicleregistration, vehiclemakeid = vehiclemakeid, vehiclemakes = vehiclemakes, vehiclemodelid = vehiclemodelid, vehiclemodels = vehiclemodels, vehicleranges = vehicleranges, vehiclerangeid = vehiclerangeid, date = date }; return view(viewmodel); }
the above method used initialy display view fine if input parameters null, when call action result again need use parameters can't null.
i can run project revive null when click on action link, move right method.
can try accessing ike : request.params[0]
Comments
Post a Comment