문제

İ 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?

올바른 솔루션이 없습니다

다른 팁

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");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top