Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

Javascript function for popup:
JavaScript
function show_popup() {
            $find("InstrucionsCancelbtn").show();(InstrucionsCancelbtn - is ajax popup behaviorid)
        }


XML
Design page:
<br />
 Should problem persist plesse <u><a href="AboutUs.aspx" style="color: Red" onclick="show_popup()">
                                                        Contact Us</a></u> for more Information.<br />
                                                    <br />

Ajaxpopup:
ASP.NET
<ajaxtoolkit:ModalPopupExtender ID="ModalPopupExtenderID"  runat="server" BehaviorID="InstrucionsCancelbtn"
    TargetControlID="InstructionsHyperLink" PopupControlID="InstructionsPanelId"
    BackgroundCssClass="modalBackground">

<asp:Panel ID="InstructionsPanelId" runat="server" CssClass="modalPopup">
    <div class="inner" id="PopUpInstructions">
    </div>
    <table>
        <tr valign="top" style="padding-removed 400px;">
            <td style="width: 100px">
                Description:
            </td>
            <td style="width: 230px">
                <asp:TextBox ID="txtDescription" Height="50px" Width="230px" CssClass="text text_Box-large"
                    Wrap="true" runat="server" word-wrap="word-break;" TextMode="MultiLine">
                <asp:Label ID="lblalert" runat="server" ForeColor="Red" Text="">
            </td>
        </tr>
        <tr valign="middle">
            <td align="center" colspan="2" valign="middle" style="width: 100%;">
                <img id="imgsavecomments" title="Save"  runat="server" src="~/Images/ico_save.gif"
                    alt="Save"  önclick="javascript:AddDescriptionPopup();" />
                <img id="imgdeletecomments"  runat="server" title="Delete" src="~/Images/ico_delete.gif"
                    alt="Delete"  önclick="javascript:DeleteDescriptionPopup();" />
            </td>
        </tr>
    </table>
    <asp:HyperLink ID="InstructionsHyperLink" runat="server" OnClick="Description();"
        Font-Underline="True" ForeColor="Blue" />

If I click the contact us, I need to open the popup window, this is the code and popup window is opening but not stay on the screen at the same time, it get closed. Why its happening?
Posted
Updated 14-Mar-12 1:40am
v3

Have you checked that there is no postback happening? IMO using JQuery UI dialog gives more control and better performance.
 
Share this answer
 
v2
if possible you can take a linkbutton

<asp:LinkButton ID="InstructionsHyperLink"... /> instead of <a href="" .../>

Now on..

LinkButton1_onclick(....)
{
ModalPopupExtenderID.show();

}
 
Share this answer
 

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