프로그램 세상/ASP.NET

소년포비 2009. 10. 24. 02:13

if (Request.UrlReferrer == null)
                        {
                                Response.Redirect ("list.aspx");
                        }
                        else
                        {
                                string refer = Request.UrlReferrer.ToString ();
                                string ServerPath = Request.Url.ToString ();

                                ServerPath = ServerPath.Substring (0, ServerPath.LastIndexOf ("/"));

                                if (refer.IndexOf (ServerPath) == -1)
                                        Response.Redirect ("list.aspx");
                        }