mardi 3 mars 2015

How to solve browse button cannot be empty?

I have Browse button which the user will click and browse the file to upload. it can load the with no issues at all. now my problem is when you click Browse button and decided not to continue will uploading the file, it throws an error saying ;


The URL cannot be empty


Question : How can i prevent url cannot be empty error message


I have this validations of which seems not working.


this is my method



public void BrowseFile()
{
try
{
string PathSelection = "";
if (txtInputfile.Text.Length > 0)
{
PathSelection = txtInputfile.Text;
}
}
}


this is my button



private void btnBrowse1_Click(object sender, EventArgs e)
{
BrowseFile();
}

Aucun commentaire:

Enregistrer un commentaire