Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8835927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:22:27+00:00 2026-06-14T09:22:27+00:00

On my current project I need to add a functionality that allows the user

  • 0

On my current project I need to add a functionality that allows the user to view a thumbnail of their uploaded PDF. I’ve found a handy component that achieves this (the basic version is free, but it’s enough for my current needs). Anyways, the control is pretty outdated (2010), therefore there doesn’t seem to be MVC support. On the demos they depict usage of the control as such:

The View’s Markup:

<form method="post" runat="server" enctype="multipart/form-data">
       <asp:Panel ID="thumbnailsPanel" runat="server" />
</form>

The thumbnail control is instantiated via code, the byte array which represents the thumbnail is passed to the control and the control is added to thumbnailsPanel

<script runat="server">
protected void DisplayThumbs_Click( object sender, System.EventArgs e )
{
      Thumbnail thumbnail = new Thumbnail();
      thumbnail.SessionKey = sessionID;
      thumbnail.Index = i;
      thumbnailsPanel.Controls.Add( thumbnail );
}
</script>

Given that I can’t declare a Thumbnail control in my razor view, how would I used this control in MVC? I’ve spent a few hours trying to make this control MVC friendly to no avail, the best I’ve come up with is to include a .ASPX view (not.cshtml) in my project and render the Thumbnail control on that view. Obviously this is not desirable.

So how would you go about using a ASPX server controls in MVC? Is the idea a bad one altogether and should not be practised?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:22:28+00:00Added an answer on June 14, 2026 at 9:22 am

    I worked around it in a project of mine by reimplementing the control as a HtmlHelper. Assuming the control isn’t too complicated then it should work for you too. Do this:

    1. Dump the Control’s source using Reflector
    2. Massage the source so it actually compiles (as source from Reflector doesn’t usually compile straight away)
    3. Identify what state the control has. Convert the state from member properties into members of its own new ViewModel class.
    4. Find the Render method and convert it to a HtmlHelper that uses ViewContext.Writer

    For example:

    public class FooControl : Control {
        public String Message { get; set; }
    
        public override void Render(HtmlTextWriter wtr) {
            wtr.WriteLine("<p>");
            wtr.WriteLine( message );
            wtr.WriteLine("</p>");
        }
    }
    

    Becomes this:

    public class FooViewModel {
        public String Message { get; set; }
    }
    
    // This method should exist in a static Extensions class for HtmlHelper
    public static void Foo(this HtmlHelper html, FooViewModel model) {
        HtmlTextWriter wtr = html.ViewContext.Writer;
        wtr.WriteLine("<p>");
        wtr.WriteLine( model.Message );
        wtr.WriteLine("</p>");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a current project I need to support finding a User by login credentials
For my current project, I am creating a php script that allows our Instructors
in my current project i need to realize questionnaire (survey) constructor functionality (kind of
In my current project, I need to add information from an xml file to
I'm creating a visual studio add in that adds files to the current project
1) I have old project that I need to modify. I need to add
I'm designing a user table for my current project. I want to add a
For my current app, I need to add a file chooser. The user should
for my current project i need to consume messages from many destinations (from hundreds
In a current project i need to display PDFs in a webpage. Right now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.