Retreiving value of an selected item in a dropdownlist which is in a usercontrol

Last post 05-15-2008 10:40 PM by Nai-Dong Jin - MSFT. 5 replies.

Sort Posts:

  • Retreiving value of an selected item in a dropdownlist which is in a usercontrol

    05-12-2008, 5:31 AM
    • Member
      point Member
    • sanju baba
    • Member since 12-26-2007, 9:22 AM
    • Posts 25

    Hi,

       I have a dropdownlist in a usercontrol.

      i am dragging the usercontrol in an aspx page.

     in javascript i want to check whether an item is selected in that dropdownlist. how to check whether an item has been selected or not using javascript in that aspx page??

  • Re: Retreiving value of an selected item in a dropdownlist which is in a usercontrol

    05-12-2008, 6:11 AM
    • Star
      9,462 point Star
    • kamii47
    • Member since 05-26-2005, 4:04 PM
    • Karachi, Pakistan
    • Posts 2,201
    Kamran Shahid
    Sr. Software Engineer
    (MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])

    Remember to click "Mark as Answer" on the post that helps U
  • Re: Retreiving value of an selected item in a dropdownlist which is in a usercontrol

    05-12-2008, 10:21 AM
    • Member
      point Member
    • sanju baba
    • Member since 12-26-2007, 9:22 AM
    • Posts 25

    I am dragging a user control in the aspx page. it will go like this:

    <td align="left"> 

    <uc1:DropFinYearC ID="drpFinYearC" runat="server" />

    </td>

    where DropFinYearC is a user control . now how will i get the item value from the dropdownlist from this usercontrol in the aspx page where i have dragged the DropFinYearC usercontrol??

    Filed under:
  • Re: Retreiving value of an selected item in a dropdownlist which is in a usercontrol

    05-12-2008, 10:31 AM
    Answer
    • Star
      9,462 point Star
    • kamii47
    • Member since 05-26-2005, 4:04 PM
    • Karachi, Pakistan
    • Posts 2,201

     You may expose a property from the usercontrol for the dropdownlist

    Then u can access it from the aspx page 

    Kamran Shahid
    Sr. Software Engineer
    (MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])

    Remember to click "Mark as Answer" on the post that helps U
  • Re: Retreiving value of an selected item in a dropdownlist which is in a usercontrol

    05-13-2008, 1:24 AM
    • Member
      point Member
    • sanju baba
    • Member since 12-26-2007, 9:22 AM
    • Posts 25

    hi,

      how to expose a property of a usercontrol in a javascript ??

    Filed under:
  • Re: Retreiving value of an selected item in a dropdownlist which is in a usercontrol

    05-15-2008, 10:40 PM
    Answer

    Hi,

     

    Just regard your user control as a server control. You may expose a property from your user control, and get the object instance of the user control in your javascript code.

     

    How to use server control in javascript, see:

     

    http://www.vbforums.com/showthread.php?t=332331

     

    Thanks.

     

    Michael Jin.
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (6 items)