Reputation: 75
I have view name called PrintPatientConsent.aspx
. I need to call it for two types.
But, by default only default action method only called. even though i passed parameters.
For your reference:
[AcceptVerbs("GET")]
public ActionResult PrintPatientConsent()
{
----
}
[AcceptVerbs("GET")]
[ActionName("PrintPatientConsent")] // i tried to pass action name
public ActionResult PrintPatientConsent(int id)
{
------
}
Javascript:-
Ex-Code:
url = '/Emr/Patients/PrintPatientConsent?Id=' + idd; //where i'm calling Parameterized actionmethod
TopUp.display(url)
Can any one please help me to find out the solution.., thanx in advance.
Upvotes: 1
Views: 73
Reputation: 4862
One of the solutions is
public ActionResult PrintPatientConsent(int? id)
{
if(id == null) {
// case A
}
else {
// case B
}
}
You can also use the method selection attribute: The current request for action {0} on controller type {1} is ambiguous
Upvotes: 1