Last post Feb 20, 2012 08:18 PM by dtromp
Feb 16, 2012 04:33 AM|dtromp|LINK
I am using the updated tabs control from the latest version of the AJAX Control Toolkit with OnDemand set to True so it uses AJAX to load the tabs when they are being selected. I also use an UpdatePanel elsewhere on the page. I noticed that when the UpdatePanel
is present on the page, a hash (or pound) sign (#) is added on postback (AJAX partial update) at the end of the URL.
This behavior does not occur when I remove the UpdatePanel from the page. It also does not occur on FireFox whereas it does show this behavior in Internet Explorer and Google Chrome.
Does anybody know what is causing this behavior and how I can stop it?
Feb 20, 2012 02:41 AM|BU XI - MSFT|LINK
You may check if your control that triggers the UpdatePanel has a #, for example <a href="#somewhere">. You may also narrow down this by putting just one UpdatePanel in an empty page, see if the hash comes up again.
For ajax feature, if you'd like to load content since you last time post back, it may use hash to remember. So when you press back button, the browser may navigate to the content last time you read.
Feb 20, 2012 08:18 PM|dtromp|LINK
I was able to narrow the issue down to the validator controls like the RequiredFieldValidatorcontrol, the UpdatePanel has nothing to do with it.
The href="#" is added to the control (TabContainer) that triggers the update but the interesting thing is that when I create a page that includes a TabContainer and a RequiredFieldValidator with property EnableClientScript set to false, the # is not added
to the URL even though href="#" is used.
When I change the EnableClientScript value to true on the RequiredFieldValidator the # is added to the URL. Try the difference using the code below by changing the EnableClientScript value on the RequiredFieldValidator from false to true and you will see
what I mean: (This works fine in FireFox but does not in Internet Explorer 9)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
<asp:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
<asp:TabPanel runat="server" HeaderText="TabPanel2" ID="TabPanel2">
<asp:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
<asp:TextBox ID="TextBoxName" runat="server" EnableViewState="False"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
<asp:Button ID="Button1" runat="server" Text="Button" />