Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Exiting For Loop

$
0
0

I need help with exiting a FOR LOOP - I need to loop the page and grab the data from only the TEXTBOXES with data and skip the empty text box. Currently my loop is entering redundant data into the database.  Sample code below-

 For Each Ctrl As Control In PHVendorAttendee.Controls

     If ObjtxtVendAttendeeFName.Text.Trim <> String.Empty And ObjtxtVendAttendeeLName.Text.Trim <> String.Empty Then

       'Insert data (my codes goes ) 

    Else

        Skip empty TEXTBOX(How do I skip the empty textboxes in my for loop and only grab the text from the non-empty textboxes)

    End if

Next

Sample Design View

1. ____Textbox with Data_________

2 ____Textbox with Data_________

3. __________________________________  (empty textbox)


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>