I have a page with a search button that is ajaxified for a user control and a radgrid. When the user clicks the button the page post back does some error checking. If it finds errors it displays them using the user control, otherwise it runs the query in the onneeddatasource and the Grid results display. If the user clicks the button and there are not any errors the grid displays correctly using the "Outlook" skin. If the user clicks the button and there are errors the the page uses a user control to send the error messages and they are displayed. However, if the user corrects the errors and clickson the button the errors are cleared as expected, the query runs and the grid is displayed but without using the "Outlook skin. So the grid is not formatted.
What's the issue???
ASCX:
Aspx:
Code Behind:
What's the issue???
ASCX:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PageMessage.ascx.cs" Inherits="AARatesWeb.PageMessage" %> |
<div runat="server" id="MessageContainer"> |
</div> |
CodeBehind: |
public void DisplayMessage(MessageType MsgType, String MsgText, String UserID) |
{ |
string sOutput; |
// Begin Table Construction |
sOutput = "<table border='0' cellpadding='0' cellspacing='0' >"; |
sOutputsOutput = sOutput + "<tr>"; |
switch (MsgType) |
{ |
case MessageType.Information: |
sOutputsOutput = sOutput + "<td class='redtext'>"; |
break; |
case MessageType.Warning: |
sOutputsOutput = sOutput + "<td class='redtext'>"; |
break; |
case MessageType.Critical: |
sOutputsOutput = sOutput + "<td class='redtext'>"; |
break; |
} |
//Finish Table Construction |
sOutputsOutput = sOutput + MsgText; |
sOutputsOutput = sOutput + "</td></tr></table>"; |
//Write message to Div |
MessageContainerMessageContainer.InnerHtml = MessageContainer.InnerHtml + sOutput; |
} |
Aspx:
<asp:Content ID="arMain" ContentPlaceHolderID="MainPH" runat="server"> |
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="rcbCodeList"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="rcbListType" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
<telerik:AjaxUpdatedControl ControlID="rtbCode" /> |
<telerik:AjaxUpdatedControl ControlID="btnAddCode" /> |
<telerik:AjaxUpdatedControl ControlID="rlbCodes" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="rcbListType"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="rtbCode" /> |
<telerik:AjaxUpdatedControl ControlID="btnAddCode" /> |
<telerik:AjaxUpdatedControl ControlID="rlbCodes" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="btnAddCode"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="rtbCode" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
<telerik:AjaxUpdatedControl ControlID="rlbCodes" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="btnSearch"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="ARGrid1" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
<telerik:AjaxUpdatedControl ControlID="lnkbtnSave" |
LoadingPanelID="" /> |
<telerik:AjaxUpdatedControl ControlID="lnkbtnSaveAs" |
LoadingPanelID="" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="ARGrid1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="ARGrid1" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManagerProxy> |
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Outlook"> |
</telerik:RadAjaxLoadingPanel> |
... |
<pm:PgMsg ID="PgMessage" runat="server" /> |
Code Behind:
protected void Page_Load(object sender, EventArgs e) |
{ |
//Set up client side calls for AjaxProxyManager |
RadAjaxManager manager = RadAjaxManager.GetCurrent(Page); |
manager.ClientEvents.OnRequestStart = "onRequestStart"; |
manager.AjaxSettingCreated += new RadAjaxControl.AjaxSettingCreatedDelegate(manager_AjaxSettingCreated); |
manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest); |
//Add user control to Ajaxify for search and add buttons |
Control mainPlaceHolder = Master.FindControl("MainPH"); |
Control pgMsg = mainPlaceHolder.FindControl("pgMessage"); |
RadAjaxLoadingPanel ajaxLoadingPanel = Master.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel; |
manager.AjaxSettings.AddAjaxSetting(btnSearch, pgMsg, ajaxLoadingPanel); |