Click here to Skip to main content
16,012,352 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a datalist in my web page.In it i had used a link buttons in a list...
In the datalist itemcommand i had written the code to open each popup according to command name of the link buttons..but when i am clicking in one linkbutton all the popup were opend..i need only one popup will open at one click..it was worked nicely in other web pages...i d't know wat happened in this page...plz give me a suggestion...

this was my code

C#
protected void dlArmyToday_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "History")
        {
            btnhistory.CommandArgument = e.CommandArgument.ToString();
            BindHistory();
            popArmyHistory.Show();
        }
        if (e.CommandName == "EditDetails")
        {
            ImgCancel.CommandArgument = e.CommandArgument.ToString();
            BindEditDetails();
            popupEdit.Show();
        }
        if (e.CommandName == "Approve")
        {
            btnCancel.CommandArgument = e.CommandArgument.ToString();
           // popupApprove.Show();
            popArmyHistory.Show();
        }

        if (e.CommandName == "True" || e.CommandName == "False")
        {
            btnActiveCancel.CommandArgument = e.CommandArgument.ToString();
            //Active();
            popupActive.Show();
        }
    }



the source file is 




  <asp:Button runat="server" ID="btnFakeTarget" style="display:none;" />
     

    <ajaxToolkit:ModalPopupExtender ID="popArmyHistory"  runat="server" TargetControlID="btnFakeTarget"
        PopupControlID="pnlArmyHistory" CancelControlID="btnhistory" BackgroundCssClass="modalBackground" />
    <asp:Panel ID="pnlArmyHistory" runat="server">


     <div class="popupWindowTitle">
    <div class="hedredcolor">History</div>
    <div style="float:right"><asp:ImageButton ID="btnhistory" ImageUrl="~/Inc/Image/Page/close.png" 
                        runat="server" /></div>
   </div>

     <div class="popupWindow" align="center">
      <asp:UpdatePanel ID="panel" runat="server">
     <contenttemplate>
     <table width="600" border="0" align="center" cellpadding="2" cellspacing="2">
       
       
       
       
       
        <tr>
            <td align="left" valign="middle" class="normaltext">
                Activated On:
            </td>
            <td align="left" valign="middle" class="normaltext">
                <asp:Label ID="lblActivatedOn" runat="server" Text="">
            </td>
        </tr>
        <tr>
            <td width="27%" align="left" valign="middle" class="normaltext">
                Reason for Activation:
            </td>
            <td align="left" valign="middle" class="normaltext">
                <asp:Label ID="lblAReason" runat="server" Text="">
            </td>
        </tr>
    </table>
      </contenttemplate>
     
     </div>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900