Invalid path for child request

Q: I call another web page from the application and pass it an argument (see sample below), but I receive the error "Invalid path for child request".

Dim strPath As String = "Error.aspx?Msg=" & strMsg
Server.Transfer(strPath, True)


A: Since the argument passed is not URL encoded, it causes the path of the web page being called to be incorrect. To correct the problem simply URL encode the argument being passed to the new page.

Dim strPath As String = "Error.aspx?Msg=" & Server.UrlEncode(strMsg)
Server.Transfer(strPath, True)

Comments

  1. You've made a terrific blog. If you have a web site, I'm sure you'd like FREE Content Get your FREE Content

    ReplyDelete

Post a Comment

Popular posts from this blog

.NET MAUI with Blazor vs. XAML

Jun '25 Tech Events