Question

İ have a hybrid project. it was a web forms project before then we convert it to mvc project and now old pages are web forms and new ones are mvc.

i have a control named as PickImage.ascx

normally i can load the control by using following code.

        Controls_ImagePicker imagePicker = (Controls_ImagePicker)LoadControl("~/Controls/ImagePicker.ascx");
        imagePicker.FileClass = FileClass.COURSE_ICON;
        imagePicker.RandomIfEmpty = false; 
        imagePicker.FileID = iconID;

but now i want same thing in mvc controller page. how can i do this?

No correct solution

OTHER TIPS

i have create an instance of my page and then loaded the control.

        Page  aspx = new Page();
        Controls_ImagePicker imagePicker = (Controls_ImagePicker)aspx.LoadControl("~/Controls/ImagePicker.ascx");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top