If else condition fails, in VB.net
-
Hello Experts, I am wondering if anyone in here can help me understand this simple concept.
if ddl="abc" and fileuplaod1.HasFile Then
UploadFile
Bool=true
Else if ddl="abc" and FileUpload1.HasFile=false Then
Alert asking for fileupload
Bool=false
Else
Bool=TrueIf Bool=True then
DataBind to GridviewSo in here my second condition executes though one of them is false. How can I stop that?
Your help is much appreciated. Thanks Happy Coding!
-
Hello Experts, I am wondering if anyone in here can help me understand this simple concept.
if ddl="abc" and fileuplaod1.HasFile Then
UploadFile
Bool=true
Else if ddl="abc" and FileUpload1.HasFile=false Then
Alert asking for fileupload
Bool=false
Else
Bool=TrueIf Bool=True then
DataBind to GridviewSo in here my second condition executes though one of them is false. How can I stop that?
Your help is much appreciated. Thanks Happy Coding!
and also
? (Guessing.) -
Hello Experts, I am wondering if anyone in here can help me understand this simple concept.
if ddl="abc" and fileuplaod1.HasFile Then
UploadFile
Bool=true
Else if ddl="abc" and FileUpload1.HasFile=false Then
Alert asking for fileupload
Bool=false
Else
Bool=TrueIf Bool=True then
DataBind to GridviewSo in here my second condition executes though one of them is false. How can I stop that?
Your help is much appreciated. Thanks Happy Coding!
-
and also
? (Guessing.) -
and also
? (Guessing.)I have a linkbutton in Gridview which downloads uploaded file. When I click on download linkbutton, it only downloads the file when all the textboxes above grid are not empty. Ex: txt1 txt2 fileupload Grid after giving values to txt1, txt2 and file uploaded I click on button and Gridview is populated with the values entered which has a Download link button that downloads the attached file. Now when I click on Download if txt1 and txt2 are empty it shows Required field validator asking me to fill those fields. Only after filling it Downloads the file. Do you know why is this weird thing happening?
Your help is much appreciated. Thanks Happy Coding!
-
I have a linkbutton in Gridview which downloads uploaded file. When I click on download linkbutton, it only downloads the file when all the textboxes above grid are not empty. Ex: txt1 txt2 fileupload Grid after giving values to txt1, txt2 and file uploaded I click on button and Gridview is populated with the values entered which has a Download link button that downloads the attached file. Now when I click on Download if txt1 and txt2 are empty it shows Required field validator asking me to fill those fields. Only after filling it Downloads the file. Do you know why is this weird thing happening?
Your help is much appreciated. Thanks Happy Coding!
You probably told it to.
-
You probably told it to.
-
I have a linkbutton in Gridview which downloads uploaded file. When I click on download linkbutton, it only downloads the file when all the textboxes above grid are not empty. Ex: txt1 txt2 fileupload Grid after giving values to txt1, txt2 and file uploaded I click on button and Gridview is populated with the values entered which has a Download link button that downloads the attached file. Now when I click on Download if txt1 and txt2 are empty it shows Required field validator asking me to fill those fields. Only after filling it Downloads the file. Do you know why is this weird thing happening?
Your help is much appreciated. Thanks Happy Coding!
i dont use the Vs validation controls, they can be annoying especially in this case where it want to force you to enter something even if you want to do something entirely separate to the problem controls. The way i solve this, is that i ajaxify(Update panels and add Triggers) the control, if you have two controls that are causing a Problem why dont you handle validation manually ?
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
i dont use the Vs validation controls, they can be annoying especially in this case where it want to force you to enter something even if you want to do something entirely separate to the problem controls. The way i solve this, is that i ajaxify(Update panels and add Triggers) the control, if you have two controls that are causing a Problem why dont you handle validation manually ?
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
I really didn't understand "
Quote:
why dont you handle validation manually ?
Can you explain me how to do it manually?
Your help is much appreciated. Thanks Happy Coding!
Remove the Validation controls on these controls txt1 txt2 fileupload and trap for things that might go wrong e.g when you trying to add etc... after you remove those validation controls , it will solve your Grid issue.
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
Remove the Validation controls on these controls txt1 txt2 fileupload and trap for things that might go wrong e.g when you trying to add etc... after you remove those validation controls , it will solve your Grid issue.
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com
-
Thanks but I still did not understand it. I am new to DotNet so this is taking time to understand.
Your help is much appreciated. Thanks Happy Coding!
please post your html here and i will fix it here for you
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com