I have a custom user control that I use within a Master Page. The user control has a mix of Telerik and asp.net controls. I am using an Ajax manager on the Master Page with a Proxy on the user control. Everything updates fine but 2 of my Label controls loose there formatting when they are "Ajaxified". Removing the Ajax manager from the Master page immediately restores the formatting, but of course the Proxy won't work without the manager. Placing the manager directly in the user control has the same effect.
Basically I am using the label controls as tokens and I need them to remain inline. e.g. Hello<asp:Label> NOT
Hello
<asp:Label>
Here is some sample code. I shortened it for brevity as my user control has lots of fields and panels (a survey type user control).
FYI. This is all being done in a Sitefinity site.
MasterPage
UserControl.ascx
On each button click the code behind updates the visibility of the current and next panel, updates the label control, and changes the status of a slider (like a progress bar).
CodeBehind ascx.cs
CSS
It would be great if after all of this someone pointed out a CSS problem, but I don't think thats it. Remove AJax and everything formats properly. What is interesting is that when Ajax is used the controls in question stack exactly as they are displayed in the Ajax Tree.
???
Thanks.
Joe
Basically I am using the label controls as tokens and I need them to remain inline. e.g. Hello<asp:Label> NOT
Hello
<asp:Label>
Here is some sample code. I shortened it for brevity as my user control has lots of fields and panels (a survey type user control).
FYI. This is all being done in a Sitefinity site.
MasterPage
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="SingleCenterColumn.master.cs" |
Inherits="App_Master_SingleCenterColumn" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<div id="wrapper"> |
<form id="form2" runat="server"> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<telerik:RadAjaxManager ID="AjaxManager1" runat="server"> |
</telerik:RadAjaxManager> |
<div id="centerwrapper"> |
<div id="header" class="borders"> ... |
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NeedsSurvey.ascx.cs" Inherits="NeedsSurvey_NeedsSurvey" |
ClassName="NeedSurvey" %> |
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="Button1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="percentage" /> |
<telerik:AjaxUpdatedControl ControlID="number" /> |
<telerik:AjaxUpdatedControl ControlID="panel1" /> |
<telerik:AjaxUpdatedControl ControlID="panel2" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"> |
</telerik:RadAjaxLoadingPanel> |
<h1> |
Needs Assessment Survey</h1> |
<div id="slider"> |
<asp:Label ID="percentage" runat="server" Text="0"></asp:Label>% Complete. Question |
<asp:Label ID="number" runat="server" Text="0"></asp:Label> of 12 Completed. |
<telerik:RadSlider ID="RadSlider1" runat="server"> |
</telerik:RadSlider> |
</div> |
<asp:Panel runat="server" ID="panel1"> |
1. Which of the following best describes the personal needs you feel are the most |
immediate? |
<br /> |
<br /> |
<asp:RadioButtonList ID="RadioButtonList1" runat="server"> |
<asp:ListItem>Help with everday expenses</asp:ListItem> |
<asp:ListItem>Paying off debt</asp:ListItem> |
<asp:ListItem>Taking a vacation</asp:ListItem> |
<asp:ListItem>Home improvements</asp:ListItem> |
<asp:ListItem>Better medical coverage</asp:ListItem> |
</asp:RadioButtonList> |
<br /> |
<asp:Button ID="Button1" runat="server" OnClick="btn_Click1" /> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadioButtonList2" |
ErrorMessage="Please select an answer"></asp:RequiredFieldValidator> |
</asp:Panel>... |
CodeBehind ascx.cs
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
using System.Net.Mail; |
using System.Net.Mime; |
using System.Reflection; |
using System.Collections.Specialized; |
public partial class NeedsSurvey_NeedsSurvey : System.Web.UI.UserControl |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
#region EventHandlers |
protected void btn_Click1(object sender, EventArgs e) |
{ |
panel1.Visible = false; |
panel2.Visible = true; |
RadSlider1.Value = 1; |
percentage.Text = "8"; |
number.Text = "1"; |
} |
protected void btn_Click2(object sender, EventArgs e) |
{ |
panel2.Visible = false; |
panel3.Visible = true; |
RadSlider1.Value = 2; |
percentage.Text = "16"; |
number.Text = "2"; |
}... |
#centercolumn |
{ |
width: 900px; |
margin-top: 25px; |
margin-left: auto; |
margin-right: auto; |
padding: 10px 25px 25px 25px; |
background-color: #fff; |
color: #000; |
} |
#slider |
{ |
width: 300px; |
margin: 0 auto; |
} |
???
Thanks.
Joe