I do not advise you to wrap an entire page in an UpdatePanel
, for the following reasons:
If you want your site to be index by Search Engines, you will need to display your content on separate pages...just having a different querystring on each content section is enough. This is because for search engines Content Is King and since search engines currently cannot index dynamically generated data, they will not be able to index your pages.
Wrapping entire pages in an Update Panel
is very dangerous because of the huge overhead that is sent to the server. You will see a significant performance decrease if you do so. Read this article for more information on the subject
Because of this huge overhead, it is suggested to use the Update Panel
to update just small sections of the website (like little box widgets on the side, etc...) and not whole content sections.
Wrapping content sections in an update panel means that you will have to go the extra mile dynamically changing the url (using # anchors) manually yourself, and this is so that you will give users the ability to use the back button on their browser to go to the previous section of the site. Not having the ability to go back in a page is very annoying for users
Here is an example that demonstrates the problem with UpdatePanel
s.
The following is code for a simple aspx page with a label and a button :
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<asp:Label runat="server" ID="Label1" Text="Update Me!" /><br />
<asp:Button runat="server" ID="Button1"
Text="Postback Update" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToLongDateString();
}
And the following is a partial postback done with the UpdatePanel
when the button is clicked (notice the huge overhead involved) :
(source: encosia.com)
As you can see, the server is basically sending all the elements that are in the UpdatePanel
back to the client.
On the other hand, here is an example that involves using ASP.Net Page Methods. Notice the response sent from the server this time (no UpdatePanels involved) :
(source: encosia.com)