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

  • Home
  • SEARCH
  • 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 9063237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:56:35+00:00 2026-06-16T15:56:35+00:00

I have done my research before posting this question and I can not find

  • 0

I have done my research before posting this question and I can not find anything helpful. I do not know if it is possible to create asp.net server control with the help of jquery. I have an upload control input that runs at server and I have used a javascript code to create a new upload control input any time a particular button is clicked. But I require a new RegularExpressionValidator to be created to control each new upload control. Can this be achieved rather than using multple upload control and RegularExpressionValidator on my page. Scrutinize my code on what I have done so far.

function addFileUploadBox() {
if (!document.getElementById || !document.createElement)
    return false;

var uploadArea = document.getElementById("upload-area");
var count = uploadArea.getElementsByTagName("input").length;

    if (!uploadArea)
        return;

    var newLine = document.createElement("br");
    uploadArea.appendChild(newLine);

    var newUploadBox = document.createElement("input");

    // Set up the new input for file uploads
    newUploadBox.type = "file";
    newUploadBox.size = "20";

    // The new box needs a name and an ID
    if (!addFileUploadBox.lastAssignedId)
        addFileUploadBox.lastAssignedId = 100;

    newUploadBox.setAttribute("id", "dynamic" + addFileUploadBox.lastAssignedId);
    newUploadBox.setAttribute("name", "dynamic:" + addFileUploadBox.lastAssignedId);
    newUploadBox.setAttribute("runat", "server");
    uploadArea.appendChild(newUploadBox);
    $("<asp:RegularExpressionValidator ID='regular" + addFileUploadBox.lastAssignedId + "' ValidationExpression='(.*?)\.(jpg|jpeg|png|gif|JPG)$' runat='server' ErrorMessage='Invalid file' ControlToValidate='dynamic" + addFileUploadBox.lastAssignedId + "' ForeColor='Red'></asp:RegularExpressionValidator>").insertAfter("#dynamic" + addFileUploadBox.lastAssignedId);
    addFileUploadBox.lastAssignedId++;
}
  • 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-16T15:56:37+00:00Added an answer on June 16, 2026 at 3:56 pm

    This is not possible.

    Reason:
    Asp.net does its conversion from xhtml to its output server-side.

    Anything you have done via jquery or javascript will be done client-side. The server knows nothing about validator that you have just attempted to create.

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

Sidebar

Related Questions

Ok, I have done plenty of research on this topic before asking the question,
I have done some research on this question before deciding to ask it. I
I have done a lot of research before posting it in here. So, here
Before someone tells me this cannot be done, I have done plenty of research
Have done some research and found some stuff that may be helpful. I would
This should be quite easy, and I have done some research on this. I
Ok I am still learning this... I have Googled and done some research but
I know this question has been asked before but I haven't been able to
I have done quite a bit of research on this but I'm still having
using Java I have done some research before asking here but I was still

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.