views:

37

answers:

3

Hello

I have a popup that is shown after successfully saving in the database. It shows "Password is successfully saved" and also has a "Ok" button. I want the popup to be closed when Ok is clicked and should be redirected to login page. With my code here, it saves, shows the popup, when OK is clicked,it stays on the same page. Please help me out on this! Thanks in advance!!

protected void btnOK_Click(object sender, EventArgs e)
{        
    Response.Redirect(ApplicationData.URL_MERCHANT_SIGNUP_PAGE, false);
    Session.Remove("Info");
}

<table id="pnlPopup" runat="server" style="display:none">
    <tr>
        <td>
            <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup">
                <table width="350" height="80" class="warningPopup">
                    <tr>
                        <td>
                            <img src="images/warning_blue.gif" alt="Warning" />
                        </td>
                        <td colspan="2" align="left" style="padding-left: 75px; padding-top: 10px;">
                            Your password is succesfully been saved.
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="4">
                            <asp:Button id="btnOK" Text ="OK" runat = "server" OnClientClick="$find('mdlpop').hide(); return true;" onclick="btnOK_Click" />
                        </td>                            
                    </tr>
                </table>
            </asp:Panel>
        </td>
    </tr>
</table>
+1  A: 

Place a breakpoint on this line and hit F5:-

Response.Redirect(ApplicationData.URL_MERCHANT_SIGNUP_PAGE, false);

Do you reach it?

If yes then make sure that ApplicationData.URL_MERCHANT_SIGNUP_PAGE returns a valid URL string.

edit We need to see more code then, if the breakpoint has not been hit then the button is not forcing a post to the server. What happens if you take this bit of markup code out for now?

OnClientClick="$find('mdlpop').hide(); return true;"

Rippo
No i dont reach there. The same page is getting refreshed.
Ram
A: 

Try this on the button click

this.Page.ClientScript.RegisterStartupScript(GetType(), "dd1", "<script>window.open('URL','_top','width=500,height=200,top=300,left=300,titlebar=no,scrollbars=1,directories=0,status=0,menubar=no,toolbar=no,resizable=yes','true');</script>");
                return;
Nithesh
A: 

Hello,

this javascript function works fine. I just tested :)

function GotoRegister() { window.location = 'UserProfileNew.aspx'; return false; }

Ram