Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Why I am unable to block login of a user externally in IIS 7.5? i am getting the intranet urls and requesting urls from web.config. Both are made same
VB
in web.config

when hosted. In IIS 6 it works but not in IIS 7.5.

C#
string intranetUrl_101 = ConfigurationManager.AppSettings["INTRANETURL_101"].ToString().ToLower();
                        string intranetUrl_102 = ConfigurationManager.AppSettings["INTRANETURL_102"].ToString().ToLower();

                        string strRequestingUrl = Request.Url.ToString().ToLower();
                        bool login = true;

                        if (Role == "CA" || Role == "C3V" || Role == "C3M") //Restrict to login C3ADMIN via Internet. C3ADMIN allowed only via intranet.
                        {
                            if ((strRequestingUrl != intranetUrl_101) && (strRequestingUrl != intranetUrl_102))//C3 Admin Accessing through internet
                            {
                                lblInvalid.Text = CommonMessage.ShowMessage("102");
                                lblInvalid.Visible = true;
                               login = true;
                                //login = false;
                            }

                        }
Posted
Updated 8-Jan-14 21:07pm
v3

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