JavaScript - Microsoft JScript runtime eror:Permission denied error in document.all

Asked By mani on 14-Jul-11 08:50 AM
hi i am trying to open new window using below line..but i am getting error as
Microsoft JScript runtime error: Permission denied   in document.all line...
Jitendra Faye replied to mani on 14-Jul-11 08:53 AM

permission denied is normally the result when you try to access the content in another domain. ...

http://forums.asp.net/t/1376591.aspx

http://forums.asp.net/t/1142175.aspx

Gokhan Metepe replied to mani on 14-Jul-11 08:53 AM
Can you write your codes here?
mani replied to Gokhan Metepe on 14-Jul-11 09:05 AM
here my code

public static class ResponseHelper
{

    public static void Redirect(this HttpResponse response, string url, string target, string windowFeatures)
    {
      if ((String.IsNullOrEmpty(target) ||
        target.Equals("_self", StringComparison.OrdinalIgnoreCase)) &&
        String.IsNullOrEmpty(windowFeatures))
      {
        response.Redirect(url);
      }
      else
      {
        Page page = (Page)HttpContext.Current.Handler;
        if (page == null)
        {
          throw new InvalidOperationException(
            "Cannot redirect to new window outside Page context.");
        }
        url = page.ResolveClientUrl(url);
        string script;
        if (!String.IsNullOrEmpty(windowFeatures))
        {
          script = @"window.open(""{0}"", ""{1}"", ""{2}"");";
        }
        else
        {
          script = @"window.open(""{0}"", ""{1}"");";
        }
        script = String.Format(script, url, target, windowFeatures);
        ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true);
      }
    }
}

in my button event after login
iam using like this

 Response.Redirect("Fullview.aspx", "_blank", "menubar=0,width=1000,height=1000");
Radhika roy replied to mani on 14-Jul-11 10:59 AM
try this code

 
This error comes in two cases-

1. Your path is wrong, to which you are referring.

2. Because of, access permission to that path

check your path and its permission also.
Riley K replied to mani on 17-Jul-11 03:19 AM
You get this error when you have specified some wrong path while accessing other page

once check your path

or it may also be that when you try to access the content in another domain you might get this error.