I have the parameter configured in the macro as "CatID". However, when I drop the macro on a page, and provide a value for the parameter, it always displays as blank.
Hmm it seems like the you may want to try "catID" (no leading capitalization) for your parameter name.
Model.GetParameterValue<string>("catID");
It expects the macro parameter alias, which by default I believe get camel-cased when the macro is created, so unless you went and explicitly changed it to use "CatID" I bet it will work with "catID"
Partial View Macro Parameter Issue
I am trying to retrieve the macro parameter for a partial view.
I have the parameter configured in the macro as "CatID". However, when I drop the macro on a page, and provide a value for the parameter, it always displays as blank.
Hmm it seems like the you may want to try "catID" (no leading capitalization) for your parameter name.
It expects the macro parameter alias, which by default I believe get camel-cased when the macro is created, so unless you went and explicitly changed it to use "CatID" I bet it will work with "catID"
The casing probably helped. But really it had to do with the way I was calling the parameter.
This didn't work:
But this did:
is working on a reply...