Server.Transfer exception in master page

L

Leon Mayne

In my master page I have a textbox and button to search the site. In the
click event of the button I just want to pass all the form data across to
the search page, so I have:

Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSearch.Click
Server.Transfer("~/Search.aspx")
End Sub

Which works fine when the event is fired from a page that is in the root of
the web application, but when it is called from a subdirectory I get:

"Cannot use a leading .. to exit above the top directory"

I've seen a few references to this on the net, but no solutions. Does anyone
know what's wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top