Click here to Skip to main content
15,904,638 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCreating an ASP.NET UserControl with collection-type property Pin
kensai21-Feb-11 3:47
kensai21-Feb-11 3:47 
AnswerRe: Creating an ASP.NET UserControl with collection-type property Pin
Ali Al Omairi(Abu AlHassan)22-Feb-11 4:38
professionalAli Al Omairi(Abu AlHassan)22-Feb-11 4:38 
Questionusing Microsoft.Office.Interop.Word + timeout Pin
Member 769046020-Feb-11 18:37
Member 769046020-Feb-11 18:37 
Questionhtml to code behind Pin
Ramkumar_S20-Feb-11 15:38
Ramkumar_S20-Feb-11 15:38 
AnswerRe: html to code behind [modified] Pin
Andy_L_J20-Feb-11 15:50
Andy_L_J20-Feb-11 15:50 
GeneralRe: html to code behind Pin
Not Active21-Feb-11 4:23
mentorNot Active21-Feb-11 4:23 
AnswerRe: html to code behind Pin
Anurag Gandhi20-Feb-11 22:43
professionalAnurag Gandhi20-Feb-11 22:43 
QuestionHelp in understanding PopupControlExtender Pin
simsen19-Feb-11 0:10
simsen19-Feb-11 0:10 
Hi,

First what my goal is: I want when clicking on a button on my page a popup to appear with a list of images. When clicking on a image it should add som text (the name of the image) to a textbox on the page.

In first place I only try to let the popup appear when clicking the textbox because I don't know how to set the name of the image from the button.

My aspx code:

<table cellpadding="0" width="100%" border="0">
                                        <tr>
                                            <td style="text-align: right">
                                                <asp:Label ID="lblMessage" runat="server" Text="<%$ Resources:Resource, Message %>"></asp:Label> :&nbsp
                                            </td>
                                            <td style="text-align: left; width: 510px">
                                                <asp:TextBox Id="txtMessage" runat="server" onfocus="this.value = this.value;" MaxLength="250" Width="500px" />    
                                            </td>
                                            <td style="vertical-align: top">
                                                <asp:Button Id="btnSend" CssClass="button" runat="server" Text="<%$ Resources:Resource, Send %>" OnClientClick="SetScrollPosition()" OnClick="BtnSend_Click" />                                                
                                            </td>
                                            <td style="width: 200px">
                                                <asp:ImageButton ID="ibtnSmileys" runat="server" ImageAlign="AbsMiddle" ImageUrl="~/Images/Smiley_41_20_A.gif" />
                                                <asp:Panel ID="panSmileys" runat="server" CssClass="chatSmileyPanel">
                                                    <asp:UpdatePanel ID="upanSmileys" runat="server">
                                                        <ContentTemplate>
                                                            <asp:DataList ID="dlstSmileys" runat="server" RepeatColumns="7" RepeatDirection="Horizontal" Width="100%" CellPadding="2" CellSpacing="2" OnItemCommand="dlstSmileys_ItemCommand">
                                                                <ItemTemplate>                                                                    
                                                                    <asp:ImageButton ID="ibtnSmiley" runat="server" ImageUrl='<%# Eval("Name", "../Images/Smileys/{0}") %>' CommandName="InsertSmiley" CommandArgument='<%# Eval("Name", "{0}").ToString() %>' />
                                                                </ItemTemplate>
                                                            </asp:DataList>
                                                        </ContentTemplate>
                                                    </asp:UpdatePanel> 
                                                </asp:Panel>
                                                <ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server" 
                                                   TargetControlID="txtMessage" 
                                                   PopupControlID="panSmileys" 
                                                   Position="Bottom"
                                                   CommitProperty="value" 
                                                   OffsetX="3" OffsetY="3"> 
                                                </ajaxToolkit:PopupControlExtender>                                                
                                            </td>
                                        </tr>
                                    </table>


My datalists ItemCommand:
protected void dlstSmileys_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "InsertSmiley")
        {
            string smileyName = Convert.ToString(e.CommandArgument);
            txtMessage.Text += smileyName;
        }
    }


When I click an image in the popupcontrolextender it doesn't fire dlsSmileys_ItemCommand.....And I cann't figure out why?

If I instead of a datalist use a RadiobuttonList with some ListItems and click one of these items I get into the SelectedIndexChanged of the RadioButtonList....So I know with a RadiobuttonList it fires the command .......but why doesn't it with the DataList?

If you can suggest another way to accomplish my above goal your welcome to tell me about it. It doesn't matter in wich way I do the job.

Kind regards,
simsen Smile | :)
QuestionRe: Help in understanding PopupControlExtender Pin
Sunasara Imdadhusen21-Feb-11 23:22
professionalSunasara Imdadhusen21-Feb-11 23:22 
QuestionFormat Dynamic GridView at runtime Pin
Andy_L_J18-Feb-11 23:22
Andy_L_J18-Feb-11 23:22 
Questionc#+object copy Pin
Ramkumar_S18-Feb-11 16:30
Ramkumar_S18-Feb-11 16:30 
AnswerCross Post Pin
dan!sh 19-Feb-11 0:05
professional dan!sh 19-Feb-11 0:05 
QuestionRunning a web application on two windows Pin
xyz_999@hotmail.com18-Feb-11 5:19
xyz_999@hotmail.com18-Feb-11 5:19 
AnswerRe: Running a web application on two windows Pin
Steve Maier18-Feb-11 5:50
professionalSteve Maier18-Feb-11 5:50 
QuestionAssign a Textbox in the parent page from a ModalPopup in asp.net Pin
Vimalsoft(Pty) Ltd17-Feb-11 23:40
professionalVimalsoft(Pty) Ltd17-Feb-11 23:40 
AnswerRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Anurag Gandhi18-Feb-11 0:35
professionalAnurag Gandhi18-Feb-11 0:35 
GeneralRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Vimalsoft(Pty) Ltd18-Feb-11 0:55
professionalVimalsoft(Pty) Ltd18-Feb-11 0:55 
GeneralRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Anurag Gandhi18-Feb-11 1:18
professionalAnurag Gandhi18-Feb-11 1:18 
GeneralRe: Assign a Textbox in the parent page from a ModalPopup in asp.net Pin
Vimalsoft(Pty) Ltd18-Feb-11 1:29
professionalVimalsoft(Pty) Ltd18-Feb-11 1:29 
Questioncross query Pin
C#Coudou17-Feb-11 13:45
C#Coudou17-Feb-11 13:45 
AnswerRe: cross query Pin
GlobX17-Feb-11 14:45
GlobX17-Feb-11 14:45 
GeneralRe: cross query Pin
C#Coudou17-Feb-11 14:58
C#Coudou17-Feb-11 14:58 
GeneralRe: cross query Pin
GlobX17-Feb-11 15:08
GlobX17-Feb-11 15:08 
GeneralRe: cross query Pin
C#Coudou17-Feb-11 15:15
C#Coudou17-Feb-11 15:15 
GeneralRe: cross query Pin
thatraja17-Feb-11 15:28
professionalthatraja17-Feb-11 15:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.