asp.net mvc - How to render ascx control in mvc controller class -
İ have hybrid project. web forms project before convert mvc project , old pages web forms , new ones mvc.
i have control named pickimage.ascx
normally can load control using following code.
controls_imagepicker imagepicker = (controls_imagepicker)loadcontrol("~/controls/imagepicker.ascx"); imagepicker.fileclass = fileclass.course_icon; imagepicker.randomifempty = false; imagepicker.fileid = iconid;
but want same thing in mvc controller page. how can this?
i have create instance of page , loaded control.
page aspx = new page(); controls_imagepicker imagepicker = (controls_imagepicker)aspx.loadcontrol("~/controls/imagepicker.ascx");
Comments
Post a Comment