ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Specifying the controller with .Controller<>()
Title:
B
I
{code}
?
I am using this to specify that I want to use the MultiSelectLookup controller: @Html.Awe().MultiLookupFor(model => model.Secondary_Industry_Type).Parameter("Project_ID", @Model.Project_ID).Controller<MultiSelectLookup>() But I am getting the following error: "Cannot convert method group 'Controller' to non-delegate type 'object'. Did you intend to invoke the method?" I have a workaround where I do: public class Secondary_Industry_TypeMultiLookupController : MultiSelectController { } Then I just let the Awesome framework specify the controller. How can I avoid this workaround and specify the MultiLookup to use the MultiSelectLookup Controller?
Save Changes
Cancel
rsnider19
asked at 18 Feb 2014
I see that your class names don't match if MultiSelectController is correct then it should be .Controller<MultiSelectController>(); you can also use .Controller(string) extension, also you can specify all urls manually
at 18 Feb 2014
Omu
I mistyped here, but in my code the class names are correct. The class is in fact called MultiSelectController. I also tried .Controller("MultiSelectController") and the browser throws a 404 where it can't find http://localhost:55699/MultiSelectController/GetItems
at 18 Feb 2014
rsnider19
in asp.net mvc the Controller suffix is removed from the url so using the .Controller(string) it would have to be .Controller("MultiSelect"), so having class IndustryMultilookupController you would have .Controller<IndustryMultilookupController> or .Controller("IndustryMultilookup")
at 18 Feb 2014
Omu
Thanks Man! .Controller("MultiSelect") worked for me!
at 18 Feb 2014
rsnider19
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK