Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

My linkbutton won't postback

Posted on 2009-03-29
3
Medium Priority
?
1,371 Views
Last Modified: 2012-05-06
For some reason which eludes me, the link button LinkButton_cloneSequence, invokes the modal popup but when I hit the OK button in the modal popup, it doesn't call back to the codebehind.
I have the same thing in other places in my code, and there it works, but with the link button, something is wrong and I can't figure it out.

Thanks
<div id="availableJobSequences" class="availableJobSequences">
        <asp:UpdatePanel ID="UpdatePanel_hoverMenu" runat="server">
            <ContentTemplate>
         <asp:LinkButton ID="LinkButton_cloneSequence" runat="server" CssClass="sectionSubText"
                    CommandName="clone" CommandArgument="none" onCommand="LinkButton_cloneSequence_Click"  Text="Clone" />
                <cc1:ModalPopupExtender ID="LinkButton_cloneSequence_ModalPopupExtender" PopupControlID="panel_sequenceClone"
                    DropShadow="true" runat="server" Enabled="True" BackgroundCssClass="modalBackground"
                    RepositionMode="RepositionOnWindowResizeAndScroll" TargetControlID="LinkButton_cloneSequence"
                    CancelControlID="Cancel_Button" OkControlID="Clone_Button">
                </cc1:ModalPopupExtender>
                <asp:Panel ID="panel_sequenceClone" runat="server" CssClass="modalPopup" Width="300px"
                    EnableTheming="False" EnableViewState="False">
                    Are you sure you wish to clone the sequence
                    <br />
                    <font color="#FF0000"><b>
                        <asp:Label ID="Label_seqToClone" runat="server" Text='<%# String.Format("{0}", Eval("actionSequenceName"))%>' /></b></font><br />
                    <br />
                    <div align="center">
                        <asp:Button ID="Clone_Button" CssClass="modalPopupButton" runat="server" Text="Clone Sequence Step" />
                        <asp:Button ID="Cancel_Button" CssClass="modalPopupButton" runat="server" Text="Do Nothing" />
                    </div>
                    <br />
                </asp:Panel>
               <asp:DropDownList ID="DropDownList_sequences" runat="server" AutoPostBack="True"
                    DataSourceID="ds1" DataTextField="actionSequenceName" DataValueField="actionSequenceKey"
                    OnSelectedIndexChanged="Page_Load" CssClass="dropDownList">
                </asp:DropDownList>
                <asp:SqlDataSource ID="ds1" runat="server" ConnectionString="<%$ cs1 %>"
                    SelectCommand="xxxxx"></asp:SqlDataSource>
                <br />
                <br />
                <asp:GridView ID="GridView_actionOrder" runat="server" AutoGenerateColumns="False"
                    DataSourceID="xxxxxx" DataKeyNames="Id" Width="300px" CssClass="gridView"
                    AllowPaging="True" AllowSorting="True">
					   <HeaderStyle CssClass="headerStyle" />
                    <Columns>
                        <asp:TemplateField HeaderText="xxxxx">
                            <ItemTemplate>
                                <asp:Panel ID="PopupMenu" runat="server" CssClass="popupMenu">
                                    <asp:ImageButton ID="Image_actionUP" runat="server" src="Images/blue_up.gif" CommandName="up"
                                        CommandArgument='xxx'
                                        OnCommand="sequenceJobsGrid_onClick" Height="15px" Width="15px" />&nbsp;<asp:ImageButton
                                            ID="Image_actionDOWN" runat="server" src="Images/green_down.gif" CommandName="down"
                                            CommandArgument='xxxx'
                                            OnCommand="sequenceJobsGrid_onClick" Height="15px" Width="15px" /><br />
                                    <asp:ImageButton ID="Image_actionDELETE" runat="server" src="Images/red_delete.gif"
                                        CommandName="remove" CommandArgument='xxxx'
                                        OnCommand="sequenceJobsGrid_onClick" Height="15px" Width="15px" />
                                    <cc1:ConfirmButtonExtender ID="cbe_deleteStep" runat="server" TargetControlID="Image_actionDELETE"
                                        DisplayModalPopupID="modal_delete" />
                                    <asp:ImageButton ID="Image_actionPLUS" runat="server" src="Images/green_plus.png"
                                        CommandName="add" CommandArgument='xxxx'
                                        OnCommand="sequenceJobsGrid_onClick" Height="15px" Width="15px" />
                                    <br />
                                </asp:Panel>
                                <cc1:ModalPopupExtender runat="server" ID="modal_delete" TargetControlID="Image_actionDELETE"
                                    PopupControlID="panel_deleteStep" DropShadow="true" OkControlID="OkButton" CancelControlID="CancelButton"
                                    BackgroundCssClass="modalBackground" RepositionMode="RepositionOnWindowResizeAndScroll" />
                                <asp:Panel ID="panel_deleteStep" runat="server" CssClass="modalPopup" Width="300px"
                                    EnableTheming="False" EnableViewState="False">
                                    xxxxxxxx
                                    <br />
                                    <font color="#FF0000"><b>xxxxxx</b></font><br />
                                    xxxxxx
                                    <br />
                                    <br />
                                    <div align="center">
                                        <asp:Button ID="OkButton" CssClass="modalPopupButton" runat="server" Text="Remove Step" />
                                        <asp:Button ID="CancelButton" CssClass="modalPopupButton" runat="server" Text="Do Nothing" />
                                    </div>
                                </asp:Panel>
                                <asp:Panel runat="server" ID="d1">
                                    <asp:Label ID="l1" runat="server" Text='xxxx'></asp:Label>
                                </asp:Panel>
                                <cc1:HoverMenuExtender ID="HoverMenuExtender1" runat="server" PopupControlID="PopupMenu"
                                    TargetControlID="d1" PopupPosition="Right" OffsetX="0" HoverCssClass="popupHover">
                                </cc1:HoverMenuExtender>
                                <cc1:ModalPopupExtender runat="server" ID="ModalPopupExtender1" TargetControlID="Image_actionPlus"
                                    PopupControlID="panel_addStep" DropShadow="false" OkControlID="OkButton" CancelControlID="CancelButton"
                                    BackgroundCssClass="modalBackground" />
                                <asp:Panel ID="panel_addStep" runat="server" CssClass="modalPopup" Width="400px">
                                    What step would you like to add to the sequence?
                                    <br />
                                    <br />
                                    <asp:DropDownList ID="DropDownList_jobsToAdd" runat="server" DataSourceID="xxxxxx"
                                        DataTextField="name" DataValueField="name" CssClass="dropDownList">
                                    </asp:DropDownList>
                                    <br />
                                    <br />
                                    <div align="center">
                                        <asp:Button ID="Button1" CssClass="modalPopupButton" runat="server" Text="Add Step" />
                                        <asp:Button ID="Button2" CssClass="modalPopupButton" runat="server" Text="Do Nothing" />
                                    </div>
                                </asp:Panel>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
				</asp:GridView>
                <asp:SqlDataSource ID="xxxxxx" runat="server" ConnectionString="<%$ cs1 %>"
                    SelectCommand=".....">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="...." Name="....." Type="String" />
                        <asp:ControlParameter ControlID="DropDownList_sequences" DefaultValue="1" Name="actionSequenceKey"
                            PropertyName="SelectedValue" Type="String" />
                        <asp:Parameter Name="query" Type="String" DefaultValue=" " />
                    </SelectParameters>
                </asp:SqlDataSource>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="DropDownList_sequences" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
 
**************************************************************
CodeBehind File
**************************************************************
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
.
.
.
.            
    }
 
    void LinkButton_cloneSequence_Click(object sender, EventArgs e)
    {
.
.
.
    }
 
    void DropDownList_sequences_PreRender(object sender, EventArgs e)
    {
.
.
.
.
    }
 
    protected void sequenceJobsGrid_onClick(object sender, CommandEventArgs e)
    {
.
.
.
.
.
}

Open in new window

0
Comment
Question by:Matt_Du
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Expert Comment

by:apresto
ID: 24019377
try changing this:
onCommand="LinkButton_cloneSequence_Click"
to this:
onClick="LinkButton_cloneSequence_Click"
0
 

Accepted Solution

by:
Matt_Du earned 0 total points
ID: 24024301
Turns out I forgot the confirmButtonExtender before the modal popup extender.
0
 
LVL 23

Expert Comment

by:apresto
ID: 24024756
No objection, glad you sorted it
Apresto
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question