Kiwimoisi
Kiwimoisi

Reputation: 4182

Response.Redirect doesn't work

I am wondering why my Response.Redirect doesn't work. So basically, I read the files in my folder, or exactly the index.html. When I find it i redirect to it .

 foreach (System.IO.FileInfo thefile in fiArr)
        {
            if (thefile.Name == "index.html")
            {
                //Response.Redirect(path + "/index.html", false);
                Response.Redirect("C://inetpub//wwwroot//Folder//" + ((LinkButton)sender).ID,     false);
            }
        }

I am just wondering why this doesn't redirect anywhere.

Upvotes: 0

Views: 980

Answers (1)

Andreas Johansson
Andreas Johansson

Reputation: 86

Response.Redirect only support to redirect to a URL beginning with "http://", a virtual folder located on same server or a file in same folder.

You could add your folder with files as a virtual folder in the server and redirect to the virtual location of the file.

Another approach can be to use javascript to do a client side redirect to the file instead.

Upvotes: 7

Related Questions