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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:45:21+00:00 2026-05-12T15:45:21+00:00

I am confused about the best way to intertwine jquery/javascript with C#. I am

  • 0

I am confused about the best way to intertwine jquery/javascript with C#. I am supposed to put a javascript confirm popup into a file upload form. However the confirm only pops up if certain criteria is not met.

There are 4 elements on the form that are of importance.

  • clientId_txt – An input text field of client’s ID
  • program_radio – A radio button indicating the program type
  • file_box – browse to file button and text box
  • upload_btn – user clicks this button to upload file

When the user click the button, the program checks that the file_box file name has 3 elements:

  • it contains the current date in mmddyy format
  • it contains the clientId_txt
  • it contains the 2 character program type represented by the radio button selection (clientId_txt should be stripped from the string during this check)

If one or more of these conditions is not met, and appropriate javascript confirm message is displayed warning the user:
“Are you sure this is the correct file? Program code not found!”

The user can then click ‘Yes’ to upload anyway or ‘Cancel’ the upload.

If the upload is allowed then the file name and time is stored in a database.


What is the best way to handle this processing. Can I do all of the filename checking in jquery/javascript in onClientClick and then the uploading and database update in onClick C# side?

Or should I put a script literal inside a javascript-script tag . Then do all the processing on C# side and spit a dynamically generated javascript confirm out to the javascript literal, then triger the literal somehow?

  • 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-12T15:45:21+00:00Added an answer on May 12, 2026 at 3:45 pm

    The best way is to do both client side and server side validation. You should allow for client-side validation for user convenience, but never rely on it – it is too easily bypassed (for example, just turning javascript off in your browser).

    The ASP.Net Validator controls are built to do both client-side and server side validation. You could attach a CustomValidator control to the file upload control and run a jquery validation function on the client side. When the form is submitted, run the same check on the server side, and then do your upload processing.

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

Sidebar

Ask A Question

Stats

  • Questions 256k
  • Answers 256k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One of Java's selling points is that is is "Write… May 13, 2026 at 10:29 am
  • Editorial Team
    Editorial Team added an answer hover takes two functions as arguments: the first argument is… May 13, 2026 at 10:29 am
  • Editorial Team
    Editorial Team added an answer In your PrintTableView you can set the FixedColumnCount. e.g <xcdg:DataGridControl.PrintView>… May 13, 2026 at 10:29 am

Related Questions

I am a newbie with Fluent NHibernate and have got a question that may
I am confused about authentication with BlazeDS. Most of the few examples I have
I am going to implement a Comet chat. It is easy to make a
I am creating a linked list as in the previous question I asked. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.