Hi I want to place a server side validation on my file upload control.
I want user should not be able to submit the form unless a supporting document is uploaded on the database.
I have place this code on my from button submit before calling the save function.
I am checking count from the database table where i am storing documents and want to check if count is 0 then give java script alert.
Is this way is ok or is there any other way of validating this.
string ACount = GetDesc("select COUNT(Sno) as DocFound from test where RequestID ="+ RID +" and RequestStatus ='", "AAA");
if ACount = 0)
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>alert(\"Please upload your supporting document.\");</script>", false);
return;
}
Thanks