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
    • Loading...
    • sanju baba
    • Joined on 12-26-2007, 9:22 AM
    • Posts 24

    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
    • Loading...
    • kamii47
    • Joined on 05-26-2005, 12:04 PM
    • Karachi, Pakistan
    • Posts 1,805
    Kamran Shahid
    Sr. Software Engineer
    (MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
    Netprosys Inc.
    www.netprosys.com

    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
    • Loading...
    • sanju baba
    • Joined on 12-26-2007, 9:22 AM
    • Posts 24

    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
    • Loading...
    • kamii47
    • Joined on 05-26-2005, 12:04 PM
    • Karachi, Pakistan
    • Posts 1,805

     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])
    Netprosys Inc.
    www.netprosys.com

    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
    • Loading...
    • sanju baba
    • Joined on 12-26-2007, 9:22 AM
    • Posts 24

    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.

     

    Sincerely,
    Michael Jin.
    Microsoft Online Community Support

Page 1 of 1 (6 items)
Microsoft Communities
Page view counter