Respected Sir,
I am really tired in solving of this issue that have been arises when i would like to restrict files to access only on my Test page , here i am retriving my files in iframe in Test page, problem occurs when a user authenticated themselves then they will be redirected on welcome page and he can access my files through welcome page on Browser by knowing my Folder Name. but i do'nt want to give permissions to access on welcome page using IBrowser i only want to give my files(.mht files) that should be accessed on iframe. So please help me out.
this code as shown below doing pretty well in Visual studio "Debug mode but when i deploy this on iis 7.0 then it is not restricting my .mht files so please help , if you have any othe idea to protect then please give me .
please help me out...
from
shashi shekhar singh
I am really tired in solving of this issue that have been arises when i would like to restrict files to access only on my Test page , here i am retriving my files in iframe in Test page, problem occurs when a user authenticated themselves then they will be redirected on welcome page and he can access my files through welcome page on Browser by knowing my Folder Name. but i do'nt want to give permissions to access on welcome page using IBrowser i only want to give my files(.mht files) that should be accessed on iframe. So please help me out.
this code as shown below doing pretty well in Visual studio "Debug mode but when i deploy this on iis 7.0 then it is not restricting my .mht files so please help , if you have any othe idea to protect then please give me .
Code:
string[] url_array = new string[100];
string[] urlaspx = new string[15];
int i = 0;
int j = 0;
protected void Application_PostRequestHandlerExecute(object sender, EventArgs e)
{
string requestedurl = Request.Url.ToString(); ;
string[] requestrrl = requestedurl.Split('.');
if (requestrrl[requestrrl.Length - 1] == "aspx" || requestrrl[requestrrl.Length - 1] == "mht")
{
url_array[i] = requestedurl;
//if (returnUrl == null) returnUrl = "Secured/login.aspx";
string[] url = url_array[i].Split('.');
if (url[url.Length - 1] == "aspx" )
{
string[] pageurl = url[url.Length - 2].Split('/');
urlaspx[j] = pageurl[pageurl.Length - 1];
if (urlaspx[j] == "Test")
{
if (url[url.Length - 1] == "mht")
{
}
}
else if (url[url.Length - 1] == "aspx")
{
if (urlaspx[j] != "Test")
{
j++;
}
}
}
if (url[url.Length - 1] == "mht" && urlaspx[j] != "Test")
{
FormsAuthentication.RedirectToLoginPage();
FormsAuthentication.SignOut();
}
i++;
}
}
from
shashi shekhar singh
Comment