I 'm doing a dot net project (MVC) in which I want to pass integers (hard coded university ids) from view to Controller. In view I 'm doing
<a href="/Admin/applied/1">PU</a>
<a href="/Admin/applied/2">UET</a>
<a href="/Admin/applied/3">GC</a>
where admin is the CONTROLLER & applied is ACTION METHOD
in ACTION METHOD (applied in Admin)
public ActionResult applied(string uniId)
{
Processing of admissions on the basis of uniId
}
but when I 'm compiling this , uniId contains NULL instead of actual integer passed by <a href="/Admin/applied/1">PU</a> etc.
Kindly help me out
uniID? If not create one or change your method topublic ActionResult applied(string id)to match the default route(string id)it(string uniId). ChangeuniIdtoidroute.config.csfile