Results 1 to 2 of 2

Thread: Using ControlParameter with TextBox inside Repeater

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Using ControlParameter with TextBox inside Repeater

    Inside the OnItemCreated event (of the repeater), I get the ID of the textbox that I want to bind to the ControlParameter. I realized that using the ID alone was not working. I get a message saying something like "can't find txtBoxName in ControlParameter". I read somewhere that if I view the page source of the browser, then use the value in the Name attribute of the textbox (for the controlId property of the controlParameter), it works. But I also noticed that when I use a textbox outside the repeater, I could just use the ID of the textbox (without having to use page source to get the name, which is different from the ID in the aspx page, of the textbox). Can anyone explain the reasoning behind this?

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Using ControlParameter with TextBox inside Repeater

    Hello,

    This is all to do with the fact that each control, on the client, has to have a unique ID. In the case of a textbox directly on the page, there isn't an issue, however, when you place a Textbox within a Repeater, or other such control, that same Textbox is placed on the page in multiple places, and has such, each one will have a unique ID.

    Can you show the ASPX and code markup for what you are trying to achieve and we can take a look.

    Gary

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