0
ResponseHelper.Redirect("popup.aspx?file= "+ LogicLayer.ManualPath + _ddlPLCs.SelectedValue.ToString() + "\\" + _PLCRow[0][0].ToString() ,"_page", "menubar=0,width=100,height=100");

in the second page :

if (Request.QueryString["file"] != null)
        {
            LogicLayer.viewManual(Request.QueryString["file"].ToString());
        }

i found that slash (\) characters is removed from the file path

are there any idea ???

Chandu
  • 81,493
  • 19
  • 133
  • 134
Ragaei Mahmoud
  • 447
  • 2
  • 11
  • 26
  • slash character was removed : d:\\folder1\\manuals\\pdfs\\file1.pdf >> became d:folder1 manuals pdfs file1.pdf – Ragaei Mahmoud Jun 22 '11 at 16:49
  • 1
    I don't think the backslash character is valid for HTTP URLs. You might change them to `%5C`. Also, you may want to try the `HttpServerUtility.UrlEncode` function – Dirk Jun 22 '11 at 16:52

1 Answers1

1

The backslash (\) is not acceptable in a URL. You have to encode the characters to a %HEX value. In ASP.Net there is a method to encode a URL string, and one to decode the string.

In the View:

ResponseHelper.Redirect("popup.aspx?file= "+ System.Web.HttpUtility.UrlEncode(LogicLayer.ManualPath + _ddlPLCs.SelectedValue.ToString() + "\\" + _PLCRow[0][0].ToString()) ,"_page", "menubar=0,width=100,height=100");

In the Code Behind:

if (Request.QueryString["file"] != null)
{
   LogicLayer.viewManual(HttpServerUtility.UrlDecode(Request.QueryString["file"].ToString()));
}

Here's a similar question.

Community
  • 1
  • 1
Dirk
  • 3,030
  • 1
  • 34
  • 40