views:

96

answers:

2

So when users land a on a product page on my website we have a few products we cross sell that can be swapped in to the main view with AJAX. The title tag changes, but it doesn't flip out with the first alternate product then stays one click behind as you flip through the additional products.

The only thought I could have is that I'm not setting the title tag early enough in the postback process to have it update correctly, but I've played around with that a bit and so far I can't get it to work correctly.

Anybody know a good solution for this?

I'm assinging the title in the code behind with a simple Page.Title = "Product: "+productName;

Do I need to flip to using javascript to set it?

A: 

I think we'll need to have a look at the code... I've got the following in a basic page and clicking the button updates the title fine:

within Page_Load():

Page.Title = DateTime.Now.ToString();

within the aspx:

   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </ContentTemplate>
    </asp:UpdatePanel>
Town
A: 

I figured it out, the product update was happening after the page load because it was an event that was being fired.

Moved the title update around and it's working fine.

Joel Barsotti

related questions