On my page (root folder) I am opening a dialog with ajax loaded content (jQuery) taken from ~/ajax/WebPage.aspx?id=1. The content has an asp.net server control (a button). The problem is when I click on the button a postback happens, but instead of posting to ~/ajax/WebPage.aspx?id=1 it goes to ~/WebPage.aspx?id=1 which of course does not exist.
What is a fix, I don’t want to move my ajax page to the root folder, because it may be called from multiple places.
Set the Button.PostBackUrl Property to
~/ajax/WebPage.aspx?id=1Edit
Since you are using jQuery to load and not the UpdatePanel, use a HTML button and wire up the click event to a Javascript function that can use jQuery to do the server communication.