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 6944435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:18:23+00:00 2026-05-27T13:18:23+00:00

I have created one user control and need to convert that user control into

  • 0

I have created one user control and need to convert that user control into custom control for the dll.

In that user control I need to use two javascripts also. Now could anyone help me to know how can I add that .js file reference into custom control code?

Usercontrol code:

<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
  <script src="Scripts/jquery.MultiFile.pack.js" type="text/javascript"></script>
    <div><%-- accept attribute can be used like accept="png|jpg"--%>
                    Multiple File Upload<br />
                    <asp:FileUpload ID="FileUpload10" runat="server" class="multi" accept="" />
                    <asp:Button ID="Button3" runat="server" Text="Submit" OnClick="jQueryUploadFiles" />

        <br />
        <asp:Label ID="lblMessage" runat="server" EnableViewState="false" ForeColor="Green" />
        <br />
        <asp:Label ID="lblError" runat="server" EnableViewState="false" ForeColor="Red" />
    </div>

usercontrol.ascx.cs

  private void FileUploadUsingJQuerySelectionMethod()
        {
            // check if file has been selected
            HttpFileCollection files = Request.Files;
            for (int i = 0; i < files.Count; i++)
            {
                HttpPostedFile file = files[i];
                if (file.ContentLength > 0)
                {
                    string path = ConfigurationManager.AppSettings["FilePath"];
                    string fileName = Path.GetFileName(file.FileName);

                    // now save the file to the disk
                    file.SaveAs(path + fileName);

                    lblMessage.Text += "File : <b>" + fileName + "</b> uploaded successfully !<br />";
                }
            }
        }
  • 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-05-27T13:18:24+00:00Added an answer on May 27, 2026 at 1:18 pm

    If I understand your question correctly, you want to make sure that wherever you use this user control, the necessary JS-files get loaded too?

    I’d suggest having a look at the ClientDependency Framework for this.

    From the description of the project:

    The ClientDependency Framework is designed to affiliate any of your views & controls to CSS and JavaScript files without having to worry about if other views or controls have already been registered with them, making developing web components much easier because each component has it’s own dependencies registered for it to function.

    If you find this framework to be a bit overkill, you could always use the scriptmanager control to include your js file in the containing page.
    An explanation on how to do this can be found here:
    http://www.infinitezest.com/articles/embedding-javascript-files-in-your-custom-controls.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one user control for multiple file upload , i need to
I have created one aspx Page from that i need to access the property
We have created a User Control for ASP.Net. At any one time, a user's
I have two machines, one is an old toshiba laptop that I use at
I have made one custom user control (search text box), which basically consists of
I have created one user named tuser with create database rights in SQL server
I have created one application in flex that is accessing the Java webservice using
I have created a new method in one of the project's controllers that it
I have created two JavaScript files. One file is "validators.js" and the other is
I have created a .NET DLL which makes some methods COM visible. One method

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.