views:

45

answers:

0

Hi I have the following code:

 Dim i As Integer
    For i = 1 To 20
        Dim captionTextBox As TextBox = DirectCast(Me.FindControl("news_Image" + i.ToString() + "CaptionTextBox"), TextBox)
        Dim deleteCheckBox As CheckBox = DirectCast(Me.FindControl("Image" + i.ToString() + "DeleteCheckBox"), CheckBox)
        If Not deleteCheckBox.Checked = False Then
            If Not captionTextBox.Text = "" Then
                'Insert the value of the textbox into the column like news_Image1Caption, news_image2Caption nased on the value of i
            End If
        End If
    Next

Where the comment is in the code above, I need to insert the value of the textbox (text) into Linq columns. For example: articleToUpdate.news_Image1Caption, news_Image2Caption, but I need to change the number after news_ to the value of i in the for loop. How can I do this?

Thanks

Luke