Monday, March 26, 2012

Working with controls inside a repeater

I need to know how to handle controls inside a repeater, how to send and
recieve data from another page to one spesific control inside a repeater.
Clue:
I have a repeater that dynamicly lists out different kind of webcontrols
(based on some criterias). Each textboxes inside the repeater need to have a
"browse" button, when clicking that button another page shall open (popup)
and the user can bwrowse for some content to insert. When clicking "ok" in
the poput, the content (from a textbox) shall be inserted into the textbox
in the repeater.
Example:
Textbox 1 - button 1
Textbox 2 - button 2
Textbox 3 - button 3
.
.
.
If I click "button 1", a popup is opened and I can fill in a url path in a
textbox. When clicking "ok" in that popup I shall return to my repeater page
and the content shall be inserted into textbox1. If I click button 2, the
content shall be inserted into textbox 2 and so on...
This seems to be very hard to make, does anybody have some examples how to
do this? Please :)
<asp:Repeater runat="server" ID="repAttributes">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtImageUrl" width="650px" />
<asp:Button runat="server" ID="btnImageUrl" Text="Browse" />
</ItemTemplate>
</asp:Repeater>I got it solved by using ClientId code behind.
"yvind Isaksen" <oyvind@.webressurs.no> wrote in message
news:%23jZNIOkkIHA.6032@.TK2MSFTNGP03.phx.gbl...
>I need to know how to handle controls inside a repeater, how to send and
>recieve data from another page to one spesific control inside a repeater.
> Clue:
> I have a repeater that dynamicly lists out different kind of webcontrols
> (based on some criterias). Each textboxes inside the repeater need to have
> a "browse" button, when clicking that button another page shall open
> (popup) and the user can bwrowse for some content to insert. When clicking
> "ok" in the poput, the content (from a textbox) shall be inserted into the
> textbox in the repeater.
> Example:
> Textbox 1 - button 1
> Textbox 2 - button 2
> Textbox 3 - button 3
> .
> .
> .
> If I click "button 1", a popup is opened and I can fill in a url path in a
> textbox. When clicking "ok" in that popup I shall return to my repeater
> page and the content shall be inserted into textbox1. If I click button 2,
> the content shall be inserted into textbox 2 and so on...
> This seems to be very hard to make, does anybody have some examples how to
> do this? Please :)
>
> <asp:Repeater runat="server" ID="repAttributes">
> <ItemTemplate>
> <asp:TextBox runat="server" ID="txtImageUrl" width="650px" />
> <asp:Button runat="server" ID="btnImageUrl" Text="Browse" />
> </ItemTemplate>
> </asp:Repeater>
>
>

0 comments:

Post a Comment