Results 1 to 6 of 6

Thread: [2005] Working with User Controls

  1. #1

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    [2005] Working with User Controls

    Plz, i created a user control with three dropdownlist controls and a button. The user will select a combinations of options from these three dropdownlist control. The problem now is that:no matter the user's selection,when i try retrieving the selectedIndex of each of the three dropdownlist controls,it returns the first item on each of them
    Nobody is smarter than all of us!

  2. #2
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: [2005] Working with User Controls

    Are you setting its AutoPostBack to True?

    Could you please show us your code?
    Show Appreciation. Rate Posts.

  3. #3

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Re: [2005] Working with User Controls

    Quote Originally Posted by Harsh Gupta
    Are you setting its AutoPostBack to True?

    Could you please show us your code?
    The AutoPostBack property for the dropdownlists are set to false,the user will only need to select his choice and the button on the user control will do the postBack( i will retrieve the selectedIndex of the dropdownlists in the button's click event)
    Nobody is smarter than all of us!

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Working with User Controls

    Have you done a Page.IsPostBack check to make sure that the control only populates the first time the page is loaded and not on subsequent postbacks?

  5. #5

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Re: [2005] Working with User Controls

    Quote Originally Posted by mendhak
    Have you done a Page.IsPostBack check to make sure that the control only populates the first time the page is loaded and not on subsequent postbacks?
    Plz,dont mind me,u got it right!.The first implmentation of the user control worked well but had its dropdownlist controls' autoPostback property set to True(also i was reloading the list based on some specific options).I later made some changes to prevent the the dropdownlist from posting back to the server (and loading all possible items on page_Load event) but 4got to coment out the reloading of the dropdownlist items. I was in a rush but thanx 4 ur corrections.Plz let me get back to my work
    Nobody is smarter than all of us!

  6. #6

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Re: [2005] Working with User Controls

    plz,sorry, i 4got 2 ask, after placing the user control on my page, i want some kind of properties other "standard" asp.net controls have. properties such as tabIndex,toolTip, height etc for the user control. I guess i hav 2 inherit from the base clase (userControl? )
    Nobody is smarter than all of us!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width