JQuery and C# ASP.NET Form and File Validation
<p>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.</p>

<p>There are 4 elements on the form that are of importance.  </p>

<ul>
<li>clientId_txt -  An input text field of client's ID</li>
<li>program_radio - A radio button indicating the program type</li>
<li>file_box - browse to file button and text box</li>
<li>upload_btn - user clicks this button to upload file</li>
</ul>

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

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

<p>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!"</p>

<p>The user can then click 'Yes' to upload anyway or 'Cancel' the upload.</p>

<p>If the upload is allowed then the file name and time is stored in a database.  </p>

<p><hr /></p>

<p>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?</p>

<p>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?</p>
