Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear All,

I want to add validation or alert button when there is needed. requirement like ..

If one is textbox and other is file upload control ........

pop up when both are blank or textbox is blanked and no file selected. and not pop up when either one is filled. means

either textbox or file is selected from file upload.



So , Please tell me how to do this..

Thanks in Advance..
Mitesh
Posted
Comments
Sergey Alexandrovich Kryukov 25-Feb-13 2:04am    
Help with what? Where is your question?
—SA
Shubh Agrahari 25-Feb-13 2:06am    
window application or web application you want this??
[no name] 25-Feb-13 2:14am    
web app.

C#
if(textbox.Text=="") || (fileupload.hasFile)
{
Messagebox.show("Your Message")
Exit Sub
}
Else
{
your choice of statements.
}
 
Share this answer
 
v3
if(textbox.text=="" && fileupload.hasFile)
{
Messagebox.show("please enter the textbox and file upload")
}


Enjoy..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900