944,185 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 11356
  • ASP.NET RSS
May 1st, 2007
0

Create control at runtime

Expand Post »
i've got this code to create control at runtime..
the problem is that i've forgotten the link and i can't refer to its documentation....
the problem is...i don't understand this line:
Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))

what does this parent refer to?

ASP.NET Syntax (Toggle Plain Text)
  1. Dim options As New RadioButtonList
  2. For Each row As DataRow In ds.Tables(0).Rows
  3. Dim item As New ListItem
  4. item.Text = CStr(row("Name"))
  5. item.Value = CStr(row("Id"))
  6. options.Items.Add(item)
  7. Next
  8. Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))
  9. Select Case parent
  10. Case "sideNav"
  11. columnSidenav.Controls.Add(options)
  12. Case "footer"
  13. footerCoontainer.Controls.add(options)
  14. Case Else
  15. paceholderDefault.Controls.add(options)
  16. End Select

~i wanted to learn more~
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
shy_wani is offline Offline
34 posts
since Mar 2007
May 2nd, 2007
0

Re: Create control at runtime

Click to Expand / Collapse  Quote originally posted by shy_wani ...
i've got this code to create control at runtime..
the problem is that i've forgotten the link and i can't refer to its documentation....
the problem is...i don't understand this line:
Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))

what does this parent refer to?

ASP.NET Syntax (Toggle Plain Text)
  1. Dim options As New RadioButtonList
  2. For Each row As DataRow In ds.Tables(0).Rows
  3. Dim item As New ListItem
  4. item.Text = CStr(row("Name"))
  5. item.Value = CStr(row("Id"))
  6. options.Items.Add(item)
  7. Next
  8. Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))
  9. Select Case parent
  10. Case "sideNav"
  11. columnSidenav.Controls.Add(options)
  12. Case "footer"
  13. footerCoontainer.Controls.add(options)
  14. Case Else
  15. paceholderDefault.Controls.add(options)
  16. End Select

~i wanted to learn more~
"parent" is the column name in that specific context, the line is going to return the 1st row parent column value to "string var"
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jabijohn is offline Offline
11 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: database string in web.config not working
Next Thread in ASP.NET Forum Timeline: need help here





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC