passing the value of dropdownlist into gridview

Discussion in 'C Programming' started by PetroTiburcio, May 29, 2013.

  1. PetroTiburcio

    PetroTiburcio

    Joined:
    May 17, 2013
    Messages:
    7
    Likes Received:
    0
    Greetings everyone, I have a dropdownlist populated by my database, below is my code:

    Code (Text):
    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsNames"
                    DataTextField="Name" DataValueField="Id">
                </asp:DropDownList>
                <asp:SqlDataSource ID="dsNames" runat="server"
                    ConnectionString="<%$ ConnectionStrings:dbProfilesConnectionString %>"
                    SelectCommand="SELECT Lname+', '+Fname AS Name,Id FROM tblProfile">
                </asp:SqlDataSource>
    Beside my Dropdownlist, I have a button and below I have a Gridview, what I want to achieve is whenever I select one of the name in my Dropdownlist, then when I click the button the name should be added in gridview. I am using asp.net with c#. Any help would be appreciated. Thanks in advance. God Bless :)
     
    PetroTiburcio, May 29, 2013
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DC Gringo
    Replies:
    5
    Views:
    683
    =?Utf-8?B?U3VyZXNo?=
    Mar 3, 2004
  2. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    2,108
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,579
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  4. keithb
    Replies:
    1
    Views:
    12,928
    shauns1
    Nov 1, 2006
  5. Victor Bazarov
    Replies:
    25
    Views:
    1,311
    E. Robert Tisdale
    Mar 23, 2005
  6. dawg1998
    Replies:
    0
    Views:
    1,642
    dawg1998
    Jul 12, 2006
  7. Andy B
    Replies:
    1
    Views:
    486
  8. DC Gringo

    passing a value to an event handler from dropdownlist

    DC Gringo, Mar 2, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    271
Loading...