CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Chandigarh,India
    Posts
    11

    Accessing values od dropdown in a usercontrol.

    I have made a usercontrol consisting of a dropdownlist which is poupulated with item from database.I used this usercontrol in a datagrid but was unable to access the value selected by the user from the usercontrol.How can i access the values ?
    Regards,

    Aman

  2. #2
    Join Date
    Jul 2002
    Posts
    62
    You have to create properties of the usercontrol that are passed back to the aspx page.

    Try something like this in the usercontrol code

    Public ReadOnly Property DropDownListValue() as string
    Get
    DropDownListValue = dropdownlist1.SelectedItem.Text
    End Get
    End Property


    You would access this in your aspx page like this

    strValue = Usercontrolname.DropDownListValue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured