Tuesday, September 27, 2011

Redirection Process





 if (intResult != -1)
        {
            string strurl = "Default.aspx";
            Response.Redirect("~/redirection.aspx?mode=billok&ReturnURL=" + strurl);

        }

---------------------------------
<div>
                 <asp:Panel ID="PanelBillingComplete" Visible="false" runat="server">
                        <div style="margin-left: auto; margin-right: auto; width: 600px; border: solid 1px #ABD8FC;
                            padding: 10px; margin-top: 100px;">
                            <h1 style="font-family: verdana, arial, helvetica, sans-serif; font-weight: bold;
                                color: #6e5e85; font-size: x-large; margin-bottom: 10px; padding-bottom: 1px;">
                                <asp:Label ID="lblTransactionComplete" runat="server" /></h1>
                             <br />
                            <br />
                            Please wait, you will be redirected in 5 seconds.
                            <br />
                            <br />
                            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/Default.aspx" CssClass="content12">Go to home page</asp:HyperLink>
                        </div>
                    </asp:Panel>
                    <asp:Panel ID="PanelWelcomeBack" Visible="false" runat="server">
                        <div style="margin-left: auto; margin-right: auto; width: 600px; border: solid 1px #ABD8FC;
                            padding: 10px; margin-top: 100px;">
                            <h1 style="font-family: verdana, arial, helvetica, sans-serif; font-weight: bold;
                                color: #FF9900; font-size: x-large; margin-bottom: 10px; padding-bottom: 1px;">
                                <asp:Label ID="lblwelcomeusername" runat="server" /></h1>
                            Enjoy your stay.
                            <br />
                            <br />
                            Please wait, you will be redirected in 5 seconds back to the previous page.
                            <br />
                            <br />
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx" CssClass="content12">Go to home page</asp:HyperLink>
                        </div>
                    </asp:Panel>
                    <asp:Panel ID="PanelProfileUpdated" Visible="false" runat="server">
                        <div style="margin-left: auto; margin-right: auto; width: 600px; border: solid 1px #ABD8FC;
                            padding: 10px; margin-top: 100px;">
                            <h1 style="font-family: verdana, arial, helvetica, sans-serif; font-weight: bold;
                                color: #FF9900; font-size: x-large; margin-bottom: 10px; padding-bottom: 1px;">
                                <asp:Label ID="lblProfileUpdated" runat="server" /></h1>
                            Enjoy your stay.
                            <br />
                            <br />
                            Please wait, you will be redirected in 5 seconds back to the previous page.
                            <br />
                            <br />
                            <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Default.aspx" CssClass="content12">Go to home page</asp:HyperLink>
                        </div>
                    </asp:Panel>

</div>

--------------------
On redirection.aspx
--------------------

protected void Page_Load(object sender, EventArgs e)
    {
        string strRedirectToHomePage = "Default.aspx";

        if (!string.IsNullOrEmpty(Request.QueryString["mode"]) && !string.IsNullOrEmpty(Request.QueryString["ReturnURL"]))
        {
            string mode = Request.QueryString["mode"];
            string strURLRedirect = Request.QueryString["ReturnURL"];

            switch (mode)
            {
                case "billok":
                    PanelBillingComplete.Visible = true;
                    // lblwelcomeusername.Text = "Welcome Back " + Request.QueryString["username"];
                    lblTransactionComplete.Text = "Thank You..." + "<br/>" + "<br/>" + "Your Transaction is Successfull.!!";
                    Response.AppendHeader("Refresh", "5; url=" + strURLRedirect);
                    break;

                case "regok":
                    PanelWelcomeBack.Visible = true;
                    // lblwelcomeusername.Text = "Welcome Back " + Request.QueryString["username"];
                    lblwelcomeusername.Text = "Congratualations..." + "<br/>" + "<br/>" + "Your Registration is Successfull.!!";
                    Response.AppendHeader("Refresh", "5; url=" + strURLRedirect);
                    break;

                case "updok":
                    PanelProfileUpdated.Visible = true;
                    // lblwelcomeusername.Text = "Welcome Back " + Request.QueryString["username"];
                    lblProfileUpdated.Text = "Congratualations..." + "<br/>" + "<br/>" + "Your profile updated successfully.!!";
                    Response.AppendHeader("Refresh", "5; url=" + strURLRedirect);
                    break;


                //Thank you after logout
                //case "thankyoulogout":
                //    PanelThankYouLogout.Visible = true;
                //    Response.AppendHeader("Refresh", "3; url=" + strURLRedirect);
                //    break;

                ////Display suspended message
                //case "suspended":
                //    PanelAccountSuspended.Visible = true;
                //    Response.AppendHeader("Refresh", "12; url=" + strURLRedirect);
                //    break;

                ////Display not active - account has not been activated yet.
                //case "notactive":
                //    PanelAccountNotActivated.Visible = true;
                //    Response.AppendHeader("Refresh", "12; url=" + strURLRedirect);
                //    break;
            }
        }

    }

-----------------------------





0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More