User control Problem

Discussion in 'ASP .Net Web Controls' started by GMK, Mar 2, 2005.

  1. GMK

    GMK Guest

    Dear all
    i'm facing a problem with the user controls
    i would like to ask if anybody could help me in knowing how to handle the
    values of a user control from outside the control.
    e.g.
    i have a drop down list, this drop down list is a user control and it is
    filled according to a qurey built in the user control.
    i want to use this drop down list on different page of my application with
    the same values and data, but on each time i have several buttons that would
    use the values selected in the drop down list in a different way.
    i want to know how could i get the value of this control and if i can't can
    i create a class with an interface (HTML) that could do for me this job?

    Thank you all for your help.
     
    GMK, Mar 2, 2005
    #1
    1. Advertising

  2. GMK

    MasterGaurav Guest

    One instance is available in only one page. This holds true for ASP.Net
    1.1

    If you are ready to jump to ASP.Net 2.0, you can use submissions
    across-pages. See PreviousPage property of Page class in ASP.Net 2.0

    Or you can serialize the values to a database and keep a reference-ID
    (primary key / identity) as URL-query-string parameter for the
    subsequent page.

    Prefer migrating to ASP.Net 2.0

    HTH

    --
    Cheers,
    Gaurav Vaish
    http://www.mastergaurav.org
    http://mastergaurav.blogspot.com
    --------------------------------
     
    MasterGaurav, Mar 2, 2005
    #2
    1. Advertising

  3. You can expose the dropdownlist within your user control as a public
    control, or you could expose it through a public method or property. This
    would allow any page to interact with the dropdownlist in your user control.

    Here's more information along with some code samples:
    http://www.openmymind.net/communication/index.html
    http://www.SteveOrr.net/faq/UserCustom.aspx

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "GMK" <> wrote in message
    news:%23u%...
    > Dear all
    > i'm facing a problem with the user controls
    > i would like to ask if anybody could help me in knowing how to handle the
    > values of a user control from outside the control.
    > e.g.
    > i have a drop down list, this drop down list is a user control and it is
    > filled according to a qurey built in the user control.
    > i want to use this drop down list on different page of my application with
    > the same values and data, but on each time i have several buttons that
    > would
    > use the values selected in the drop down list in a different way.
    > i want to know how could i get the value of this control and if i can't
    > can
    > i create a class with an interface (HTML) that could do for me this job?
    >
    > Thank you all for your help.
    >
    >
     
    Steve C. Orr [MVP, MCSD], Mar 2, 2005
    #3
    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. Tom Rowton
    Replies:
    2
    Views:
    680
    Tom Rowton
    Aug 1, 2003
  2. vatech1993
    Replies:
    4
    Views:
    5,703
    =?Utf-8?B?U8Opcmdpbw==?=
    Dec 11, 2004
  3. Replies:
    0
    Views:
    441
  4. Mad Scientist Jr
    Replies:
    0
    Views:
    659
    Mad Scientist Jr
    Mar 22, 2006
  5. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    566
    Jonathan Wood
    Feb 2, 2010
Loading...

Share This Page