Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have several literal controls on my page, Literal1, Literal2, Literal3 etc

 

I have a function which takes an index

 

Private Sub UpdateLiteral(byval index as int16)

...

End Sub

 

In that sub I want to update the corresponding literal to the index that comes in, I could do:

 

Select Case index

Case 1

Literal1.Text = "new value"

Case 2

Literal2.Text = "new value"

Case 3

Literal3.Text = "new value"

End Select

 

But theres a lot more than 3 literals, how can I dynamically generate the object name that I want to manipulate?

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...