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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -