开发者

Pop up disappears when a img button in clicked (ASP.NET Ajax control tool kit)

   <Columns>
                        <asp:TemplateField HeaderText="Edit Controls" Item开发者_StackOverflow社区Style-Width="15%">
                            <ItemTemplate>
                           <asp:LinkButton ID="lnk_Edit" ToolTip="Edit User" CommandArgument='<%# Eval("UserID") %>' CommandName="Edit" runat="server"><img id="img_Edit" src="Styles/Images/Edit.jpg" runat="server" style="border-style: none" alt="Edit User" /></asp:LinkButton>

                            <asp:PopupControlExtender ID="PopUCtrlExt_Edit" runat="server" DynamicServicePath=""
                            Enabled="True" ExtenderControlID="" TargetControlID="img_Edit" PopupControlID="PanelCreateUser">
                        </asp:PopupControlExtender>

I am using Ajax to do a pop up. I am able to pop up the panel when I click the img id="img_Edit" . But what happens is when I click the pop up appears and a post back happens as a result the panel disappears. I even tried to put the grid inside a update panel but didn't work. what Should I do to make the pop up stay.


try adding OnClientClick="return false;" for LinkButton, like this:

<asp:LinkButton ID="lnk_Edit" OnClientClick="return false;" ToolTip="Edit User" CommandArgument='<%# Eval("UserID") %>' CommandName="Edit" runat="server"><img id="img_Edit" src="Styles/Images/Edit.jpg" runat="server" style="border-style: none" alt="Edit User" /></asp:LinkButton>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜