drop downs in userControls

Discussion in 'ASP .Net' started by =?Utf-8?B?Q1NoYXJwZ3V5?=, May 12, 2006.

  1. I have 3 drop downs that are populated from the databasem 4 of my web pages
    need to have this drop down, how can I trap the selection made in the drop
    down and popuate my grid on my form?
     
    =?Utf-8?B?Q1NoYXJwZ3V5?=, May 12, 2006
    #1
    1. Advertising

  2. Hi CSharpguy,

    I'm not quite sure what you mean by "trap". Do you mean you just want to
    expose the selected value to the web form containing the user control? If
    that's the case, just create three public or internal properties in the
    control representing the selected values of each dropdown. Once you
    initialize this control on your form, you'll have access to those
    properties.

    Another option is to pass the OnSelectedValueChanged event to bubble up to
    the web form so it can't react to the user control's event. If you'd like
    to elaborate, I could probably help out more.

    "CSharpguy" <> wrote in message
    news:...
    >I have 3 drop downs that are populated from the databasem 4 of my web pages
    > need to have this drop down, how can I trap the selection made in the drop
    > down and popuate my grid on my form?
    >
    >
     
    Michael Bosch, May 12, 2006
    #2
    1. Advertising

  3. i have 3 drop downs (in auser control) i have a grid on the web form, when
    the user selects a item in the drop down, and then presses the search button,
    I want to take what they have selected and run my sql query and then bind my
    grid on my page with the data linked to the drop down selection. I only want
    the drop downs in a user control

    "Michael Bosch" wrote:

    > Hi CSharpguy,
    >
    > I'm not quite sure what you mean by "trap". Do you mean you just want to
    > expose the selected value to the web form containing the user control? If
    > that's the case, just create three public or internal properties in the
    > control representing the selected values of each dropdown. Once you
    > initialize this control on your form, you'll have access to those
    > properties.
    >
    > Another option is to pass the OnSelectedValueChanged event to bubble up to
    > the web form so it can't react to the user control's event. If you'd like
    > to elaborate, I could probably help out more.
    >
    > "CSharpguy" <> wrote in message
    > news:...
    > >I have 3 drop downs that are populated from the databasem 4 of my web pages
    > > need to have this drop down, how can I trap the selection made in the drop
    > > down and popuate my grid on my form?
    > >
    > >

    >
    >
    >
     
    =?Utf-8?B?Q1NoYXJwZ3V5?=, May 12, 2006
    #3
  4. Right. Create the user control, let's say ucThreeDropDowns. Drag this
    control to the form designer. Now in your code behind initialize that
    control Make sure the name of the object matches the ID of the control on
    the web form. You will now be able to access the properties of the
    dropdowns.
    internal ucThreeDropDown uc;
    On the OnClick event of the submit button, just use the object to get the
    dropdown values. ie. uc.DropDown1.SelectedValue.

    "CSharpguy" <> wrote in message
    news:...
    >i have 3 drop downs (in auser control) i have a grid on the web form, when
    > the user selects a item in the drop down, and then presses the search
    > button,
    > I want to take what they have selected and run my sql query and then bind
    > my
    > grid on my page with the data linked to the drop down selection. I only
    > want
    > the drop downs in a user control
    >
    > "Michael Bosch" wrote:
    >
    >> Hi CSharpguy,
    >>
    >> I'm not quite sure what you mean by "trap". Do you mean you just want to
    >> expose the selected value to the web form containing the user control?
    >> If
    >> that's the case, just create three public or internal properties in the
    >> control representing the selected values of each dropdown. Once you
    >> initialize this control on your form, you'll have access to those
    >> properties.
    >>
    >> Another option is to pass the OnSelectedValueChanged event to bubble up
    >> to
    >> the web form so it can't react to the user control's event. If you'd
    >> like
    >> to elaborate, I could probably help out more.
    >>
    >> "CSharpguy" <> wrote in message
    >> news:...
    >> >I have 3 drop downs that are populated from the databasem 4 of my web
    >> >pages
    >> > need to have this drop down, how can I trap the selection made in the
    >> > drop
    >> > down and popuate my grid on my form?
    >> >
    >> >

    >>
    >>
    >>
     
    Michael Bosch, May 12, 2006
    #4
    1. Advertising

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. Davmagic .Com

    Need Script For Drop Downs

    Davmagic .Com, Oct 14, 2004, in forum: Perl
    Replies:
    0
    Views:
    454
    Davmagic .Com
    Oct 14, 2004
  2. JohnZing

    list of drop downs

    JohnZing, Jan 30, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    414
    JohnZing
    Jan 30, 2005
  3. =?Utf-8?B?TWlrZQ==?=

    dual drop downs

    =?Utf-8?B?TWlrZQ==?=, Mar 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    560
    =?Utf-8?B?VGltIFN0YWxs?=
    Mar 9, 2005
  4. BryanS
    Replies:
    0
    Views:
    429
    BryanS
    Mar 16, 2005
  5. jaysch
    Replies:
    0
    Views:
    1,245
    jaysch
    Apr 30, 2011
Loading...

Share This Page