AjaxPanel and SharePoint

11 posts, 0 answers
  1. Raman Chhina
    Raman Chhina avatar
    3 posts
    Member since:
    Jul 2008

    Posted 30 Oct 2008 Link to this post

    I am trying to use the AjaxPanel in a simple page under SharePoint / WSS and the ajax request is turning into a standard postback.  I have used the same page in a regular asp.net page and it works fine.  I am not sure what I am doing wrong here but it seems like it should work.

    I have made all the required changes to the web.config and installed asp.net ajax.  In fact, I can use other telerik controls that incorporate ajax without problem under sharepoint, e.g. RadTree, RadCombo, etc.

    Thanks for any help!
    Raman

    --- Sample Page ---
    <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

    <%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" %>

    <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
    <%@ Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register TagPrefix="wssap" Namespace="Microsoft.SharePoint.ApplicationPages" Assembly="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2008.2.723.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>

    <%@ Import Namespace="System" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="System.Security" %>
    <%@ Import Namespace="System.Web" %>
    <%@ Import Namespace="System.Web.UI" %>
    <%@ Import Namespace="System.Web.Security" %>
    <%@ Import Namespace="System.Xml" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Import Namespace="Microsoft.SharePoint.Utilities" %>

    <script language="c#" runat="server">
        protected void Button1_Click(object sender, EventArgs e)
        {
            TextBox1.Text = int.Parse(TextBox1.Text) - 1 + "";
        }


    </script>

    <asp:Content id="Content4" ContentPlaceHolderID="PlaceHolderLeftActions" runat="server">
    </asp:Content>

    <asp:Content ID="Content6" ContentPlaceHolderID="PlaceHolderMain" runat="server">

       <div>
       
            <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            </telerik:RadScriptManager>
       
        </div>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px"
            width="300px">
            <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
            <asp:TextBox ID="TextBox1" runat="server" Text="0"></asp:TextBox>
        </telerik:RadAjaxPanel>

    </asp:Content>
    <asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
      <SharePoint:EncodedLiteral ID="titleArea1a" runat="server" text="SP Ajax Test" EncodeMethod='NoEncode'/>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
      runat="server">
      <SharePoint:EncodedLiteral ID="titleArea2a" runat="server" text="SP Ajax Test" EncodeMethod='NoEncode'/>
    </asp:Content>

  2. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 30 Oct 2008 Link to this post

    Hi Raman Chhina,

    In order MS Ajax framework's UpdatePanels, which are used by RadAJAX for ASP.NET AJAX, to work correctly in MOSS environment you should apply an "UpdatePanel fix". More details about this "fix" you can find in this blog post under Using UpdatePanels within SharePoint section.

    Please give it a try and let us know if this helps.

    Sincerely yours,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  3. Chris
    Chris avatar
    58 posts
    Member since:
    Jun 2012

    Posted 10 Dec 2008 Link to this post

    Hi,
         I have  a similar problem to above. In my case only the first postback is normal all other postbacks are ajaxified. As above i a 'normal' asp.net website all is OK. It's just in my MOSS site (dev and production) that i get get the problem.

    Thank

    Chris
  4. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 11 Dec 2008 Link to this post

    Hello Chris,

    Can you please provide little more details about your scenario and implementation? Are you using a webpart or the controls are declared directly on the page? How the controls are ajaxified?

    Greetings,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Chris
    Chris avatar
    58 posts
    Member since:
    Jun 2012

    Posted 12 Dec 2008 Link to this post

    Hi Rosen,
    my set up is as follows.

    Win2K3 server R2 with all updates hot fixes etc.
    MOSS 2K7 SP1
    MS AJAX Extensions 1.0
    Web.config set up as per Mike Amaalans blog (including the panels fixups script) (note ajax works correctly with standard update panel and custom webpart in dll)
    Return of SmartPart v1.3 (using the Smartpart with AJAX webpart)
    Telerik controls v2008.3.1105.20.
    VS2008 SP1
    Targeting Framework 3.5 in controls project.
    Script Manager added to Master Page
    Not using AJAX Manger


    I have a RadAjaxPanel with a RadGrid  and some dropdownlists inside it. The drop down lists postback and filter the grid results (pulled from a SQL 2K server using SQLDatasource bound to grid). This is all in a UserControl (ascx) wich is then hosted in the SmartPart container.

    My problem is that the first action on the page after loading will result in a normal postback after this ajax works correctly and does not fail at all. This is the same on both my Dev and Production servers. (Dev server is not a clone of prod server but a clean installation on a new server). I f I run the control in the local website project on my Dev server all works correctly and the first postback is ajaxified. So this would seem to be a MOSS interaction issue with AJAX Panel.

    I have actually come across one more issue : in my dev environment the excel export works correctly, but in my producton environment (different css, master pages etc) no export happens the grid is just redisplayed, but with the column dropped that I do not export, any ideas ???.

    Many Thanks

    Chris

    Here is the aspx code :

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ParentalEmails.ascx.cs" Inherits="usercontrols_ParentalEmails" %>

    <%@ Register assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"

    namespace="Telerik.Web.UI" tagprefix="telerik" %>

    <

    telerik:RadAjaxLoadingPanel Runat="server" height="75px" width="75px"

    ID="alpMain" Transparency="40" BackColor="White"

    HorizontalAlign="Center" >

     

     

     

    <br />

     

     

     

    <br />

     

     

     

    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'

     

     

     

    style="border: 0px;" />

     

    </

     

     

    telerik:RadAjaxLoadingPanel>

     

    <

     

     

    telerik:RadAjaxPanel ID="rapCommonList" runat="server" BorderStyle="None"

    height="100%" HorizontalAlign="NotSet"

     

     

     

    LoadingPanelID="alpMain">

     

     

     

    <span class="ec-smartpart">

     

     

     

    <table ID="table1" runat="server" height="99%" width="80%">

     

     

     

    <tr >

     

     

     

    <td valign="middle" align="left" width="12%">

     

     

     

    <span class="ec-supplementaryfilter">

     

     

     

    <asp:Label ID="Label2" runat="server">YearGroup: </asp:Label><br />

     

     

     

    <asp:DropDownList ID="ddlYearGroup" runat="server" AutoPostBack="True"

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

     

     

    <asp:ListItem Text="All Years" Value="%" Selected="True" />

    <asp:ListItem Text="Year 9" Value="9" />

    <asp:ListItem Text="Year 10" Value="10"/>

    <asp:ListItem Text="Year 11" Value="11" />

    <asp:ListItem Text="Lower Sixth" Value="12" />

    <asp:ListItem Text="Upper Sixth" Value="13" />

    </asp:DropDownList>

     

     

     

    </span>

    </td>

     

     

     

    <td rowspan="6" height="100%" valign="top">

     

     

     

    <asp:Label ID="Label8" runat="server">E-mail Bcc list: </asp:Label><br />

     

     

     

    <asp:TextBox align="left" height="97%" Width="99%" ID="txtResult"

    runat="server" TextMode="MultiLine"></asp:TextBox>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    <tr >

     

     

     

    <td valign="middle" align="left" width="12%">

     

     

     

    <span class="ec-supplementaryfilter">

     

     

     

    <asp:Label ID="Label1" runat="server" >House: </asp:Label><br />

     

     

     

    <asp:DropDownList ID="ddlHouse" runat="server" AutoPostBack="True"

     

     

     

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

     

     

    <asp:ListItem Text="All Houses" Value="%" Selected="True" />

    <asp:ListItem Text="Blackwater" Value="B" />

    <asp:ListItem Text="Craig" Value="C"/>

    <asp:ListItem Text="Gonville" Value="G" />

    <asp:ListItem Text="Nugent" Value="N" />

    <asp:ListItem Text="Pennell" Value="P" />

     

     

     

    <asp:ListItem Text="Powell" Value="Pw" />

    <asp:ListItem Text="Reeves" Value="R" />

    <asp:ListItem Text="School" Value="S" />

    <asp:ListItem Text="Wargrave" Value="W" />

    <asp:ListItem Text="Watt" Value="Wt" />

    </asp:DropDownList>

     

     

     

    </span>

    </td>

     

     

     

    </tr>

     

     

     

    <tr >

     

     

     

    <td valign="middle" align="left" width="12%">

     

     

     

    <span class="ec-supplementaryfilter">

     

     

     

    <asp:Label ID="Label3" runat="server" >Gender: </asp:Label><br />

     

     

     

    <asp:DropDownList ID="ddlGender" runat="server" AutoPostBack="True"

     

     

     

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

     

     

    <asp:ListItem Text="All Genders" Value="%" Selected="True" />

    <asp:ListItem Text="Male" Value="M" />

    <asp:ListItem Text="Female" Value="F"/>

    </asp:DropDownList>

     

     

     

    </span>

    </td>

     

     

     

    </tr>

     

     

     

    <tr >

     

     

     

    <td valign="middle" align="left" width="12%">

     

     

     

    <span class="ec-supplementaryfilter">

     

     

     

    <asp:Label ID="Label5" runat="server" >Pupil Type: </asp:Label><br />

     

     

     

    <asp:DropDownList ID="ddlPupilType" runat="server" AutoPostBack="True"

     

     

     

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

     

     

    <asp:ListItem Text="All Types" Value="%" Selected="True" />

    <asp:ListItem Text="Boarder" Value="Y" />

    <asp:ListItem Text="Day" Value="N"/>

    </asp:DropDownList>

     

     

     

    </span>

    </td>

     

     

     

    </tr>

     

     

     

    <tr >

     

     

     

    <td valign="middle" align="left" width="12%">

     

     

     

    <span class="ec-supplementaryfilter">

     

     

     

    <asp:Label ID="Label4" runat="server" >Subject: </asp:Label><br />

     

     

     

    <asp:DropDownList ID="ddlSubject" runat="server" AppendDataBoundItems="true"

    DataTextField="description" DataValueField="code"

    DataSourceID="dsSubjects" AutoPostBack="True"

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

     

     

    <asp:ListItem Text="All Subjects" Value="%" Selected="True" />

    </asp:DropDownList>

     

     

     

    </span>

    </td>

     

     

     

    </tr>

     

     

     

    <tr >

     

     

     

    <td valign="middle" align="left" width="12%">

     

     

     

    <span class="ec-supplementaryfilter">

     

     

     

    <asp:Label ID="Label7" runat="server" >Set: </asp:Label><br />

     

     

     

    <asp:DropDownList ID="ddlSets" runat="server" AppendDataBoundItems="true"

    DataTextField="description" DataValueField="code"

    DataSourceID="dsSets" AutoPostBack="True"

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

     

     

    <asp:ListItem Text="All Sets" Value="%" Selected="True" />

    </asp:DropDownList>

     

     

     

    </span>

    </td>

     

     

     

    </tr>

     

     

     

    <tr visible="false">

     

     

     

    <td valign="middle" style="padding:6px,1px,6px,1px !important">

     

     

     

    <asp:LinkButton ID="lbExportPage" runat="server" CssClass="metisLinkButton"

    onclick="lbExportPage_Click">

     

     

     

    Export Page to Excel

    </asp:LinkButton>

     

     

     

    </td>

     

     

     

    <td valign="middle" style="padding:6px,1px,6px,1px !important">

     

     

     

    <asp:LinkButton ID="lbExportAll" runat="server" CssClass="metisLinkButton"

    onclick="lbExportAll_Click">

     

     

     

    Export All to Excel

    </asp:LinkButton>

    </td>

     

     

     

    </tr>

     

     

     

    <tr >

     

     

     

    <td valign="top" align="left" colspan="2">

     

     

     

    <asp:Label ID="Label6" runat="server" >Results: </asp:Label><br />

     

     

     

    <telerik:RadGrid runat="server" ID="grdResults" AllowPaging="True"

    AllowSorting="True" AllowFilteringByColumn="True"

    height="100%" GridLines="None"

    PageSize="150" DataSourceID="dsEmails"

    ondatabound="grdResults_DataBound" onitemcreated="grdResults_ItemCreated"

     

     

     

    ShowStatusBar="True" AllowMultiRowSelection = "True"

    Skin="Sunset" >

     

     

     

     

    <MastertableView>

     

     

     

    <norecordstemplate>

     

     

     

    No Email Addresses Found.

    </norecordstemplate>

     

     

     

    <RowIndicatorColumn>

     

     

     

    <HeaderStyle width="20px"></HeaderStyle>

     

     

     

    </RowIndicatorColumn>

     

     

     

    <ExpandCollapseColumn>

     

     

     

    <HeaderStyle width="20px"></HeaderStyle>

     

     

     

    </ExpandCollapseColumn>

     

     

     

    <Columns>

     

     

     

    <telerik:GridTemplateColumn uniquename="CheckBoxTemplateColumn" AllowFiltering="false">

     

     

     

    <ItemTemplate>

     

     

     

    <asp:CheckBox ID="chkSelected" runat="server" AutoPostBack="true"

    Checked="true" OnCheckedChanged="ToggleRowSelection" />

     

     

     

    </ItemTemplate>

     

     

     

    <HeaderTemplate>

     

     

     

    Hide

    </HeaderTemplate>

     

     

     

    </telerik:GridTemplateColumn>

     

     

     

    </Columns>

     

     

     

    <editformsettings>

     

     

     

    <editcolumn cancelimageurl="Cancel.gif" editimageurl="Edit.gif"

    insertimageurl="Update.gif" updateimageurl="Update.gif">

     

     

     

    </editcolumn>

     

     

     

    </editformsettings>

     

     

     

    </MastertableView>

     

     

     

    <exportsettings exportonlydata="True" openinnewwindow="True">

     

     

     

    </exportsettings>

     

     

     

    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Position="TopAndBottom" />

    <clientsettings allowcolumnsreorder="True" reordercolumnsonclient="True">

     

     

     

    </clientsettings>

     

     

     

    <filtermenu enabletheming="True">

     

     

     

    <collapseanimation duration="200" type="OutQuint" />

     

     

     

    </filtermenu>

     

     

     

    <headercontextmenu enabletheming="True">

     

     

     

    <collapseanimation duration="200" type="OutQuint" />

     

     

     

    </headercontextmenu>

     

     

     

    </telerik:RadGrid>

    </td>

     

     

     

    </tr>

     

     

     

    </table>

     

     

     

    </span>

     

    </

     

     

    telerik:RadAjaxPanel>

     

    <

     

     

    asp:SqlDataSource ID="dsSubjects" runat="server" SelectCommand="usps_GetListBoxData"

    SelectCommandType="StoredProcedure" DataSourceMode="DataSet" >

     

     

     

    <SelectParameters>

     

     

     

    <asp:Parameter Name="listBoxType" DefaultValue="SUBJECTS"/>

     

     

     

    </SelectParameters>

     

    </

     

     

    asp:SqlDataSource>

     

    <

     

     

    asp:SqlDataSource ID="dsEmails" runat="server" SelectCommand="usps_GetParentalEmailList"

     

     

     

    SelectCommandType="StoredProcedure" DataSourceMode="DataSet"

    onselecting="dsEmails_Selecting" >

     

     

     

    <SelectParameters>

     

     

     

    <asp:Parameter Name="YearGroup" DefaultValue="INIT"/>

     

     

     

    <asp:Parameter Name="House" DefaultValue="INIT"/>

     

     

     

    <asp:Parameter Name="Gender" DefaultValue="INIT"/>

     

     

     

    <asp:Parameter Name="Subject" DefaultValue="INIT"/>

     

     

     

    <asp:Parameter Name="PupilType" DefaultValue="INIT"/>

     

     

     

    <asp:Parameter Name="SetCode" DefaultValue="INIT"/>

     

     

     

    </SelectParameters>

     

    </

     

     

    asp:SqlDataSource>

     

    <

     

     

    asp:SqlDataSource ID="dsSets" runat="server" SelectCommand="usps_GetSetListBoxData"

     

     

     

    SelectCommandType="StoredProcedure" DataSourceMode="DataSet"

    onselecting="dsSets_Selecting" >

     

     

     

    <SelectParameters>

     

     

     

    <asp:Parameter Name="YearGroup" DefaultValue="INIT"/>

     

     

     

    <asp:Parameter Name="SubjectCode" DefaultValue="INIT"/>

     

     

     

    </SelectParameters>

     

    </

     

     

    asp:SqlDataSource>

     

     

     


    and the Code behind (.cs)

    using

    System;

    using

    System.Text;

    using

    System.Threading;

    using

    System.Web.UI;

    using

    System.Web.UI.WebControls;

    using

    EastbourneCollege.Global;

    using

    Telerik.Web.UI;

    public

    partial class usercontrols_ParentalEmails : UserControl

     

     

     

    {

    private void EnsureUpdatePanelFixups()

    {

    if (this.Page.Form != null)

    {

    string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];

    if (formOnSubmitAtt == "return _spFormOnSubmitWrapper();")

    {

    this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";

    }

    }

    ScriptManager.RegisterStartupScript(this, typeof(usercontrols_ParentalEmails),

    "UpdatePanelFixup", "_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;", true);

    }

    protected override void CreateChildControls()

    {

    base.CreateChildControls();

    this.EnsureUpdatePanelFixups();

    dsSubjects.ConnectionString = Constants.ConnectionString;

    dsEmails.ConnectionString = Constants.ConnectionString;

    dsSets.ConnectionString = Constants.ConnectionString;

    txtResult.Attributes.Add("onfocus", "select();");

    }

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void ToggleRowSelection(object sender, EventArgs e)

    {

    ((sender as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;

    //update email list in text box

     

     

     

    CreateOutlookEmailList();

    }

    protected void dsEmails_Selecting(object sender, SqlDataSourceSelectingEventArgs e)

    {

    //add new values for select params

     

     

     

    e.Command.Parameters["@YearGroup"].Value = ddlYearGroup.SelectedValue;

    e.Command.Parameters["@House"].Value = ddlHouse.SelectedValue;

    e.Command.Parameters["@Gender"].Value = ddlGender.SelectedValue;

    e.Command.Parameters["@Subject"].Value = ddlSubject.SelectedValue;

    e.Command.Parameters["@PupilType"].Value = ddlPupilType.SelectedValue;

    e.Command.Parameters["@SetCode"].Value = ddlSets.SelectedValue;

    }

    protected void dsSets_Selecting(object sender, SqlDataSourceSelectingEventArgs e)

    {

    //add new values for select params

     

     

     

    e.Command.Parameters["@YearGroup"].Value = ddlYearGroup.SelectedValue;

    e.Command.Parameters["@SubjectCode"].Value = ddlSubject.SelectedValue;

    }

    protected void grdResults_DataBound(object sender, EventArgs e)

    {

    CreateOutlookEmailList();

    }

    private void CreateOutlookEmailList()

    {

    StringBuilder sb = new StringBuilder();

    foreach (GridDataItem r in grdResults.Items)

    {

    if (r.Selected) continue;

    string val = r.Cells[(r.Cells.Count - 1)].Text;

     

    //only add if not in the list already

     

     

     

    if(! sb.ToString().Contains(val))

    {

    sb.Append(val + "; ");

    }

    }

    txtResult.Text = sb.ToString();

    txtResult.Focus();

    }

    protected void grdResults_ItemCreated(object sender, GridItemEventArgs e)

    {

    if (e.Item is GridDataItem)

    {

    e.Item.PreRender += Item_PreRender;

    }

    if (e.Item is GridFilteringItem)

    {

    GridFilteringItem filteringItem = e.Item as GridFilteringItem;

    //set dimensions for the filter textbox

     

     

     

    TextBox box = filteringItem["Relationship"].Controls[0] as TextBox;

    box.Width = Unit.Pixel(45);

    }

    }

    private void Item_PreRender(object sender, EventArgs e)

    {

    try

     

     

     

    {

    ((sender as GridDataItem)["CheckBoxTemplateColumn"].FindControl("chkSelected") as CheckBox).Checked =

     

     

     

    (sender as GridDataItem).Selected;

    }

    catch

     

     

     

    {

    }

    }

    protected void ddl_SelectedIndexChanged(object sender, EventArgs e)

    {

    string ddlID = (sender as DropDownList).ID;

     

    //filter the set list for the chosen YG and subhect code

     

     

     

    if (ddlID == "ddlSubject" || ddlID == "ddlYearGroup")

    {

    ddlSets.Items.Clear();

    ddlSets.Items.Add(new ListItem("All Sets","%"));

    ddlSets.DataBind();

    }

    grdResults.DataBind();

    }

    protected void lbExportPage_Click(object sender, EventArgs e)

    {

    //grdResults.PageSize = grdResults.MasterTableView.VirtualItemCount;

     

     

     

    grdResults.ExportSettings.ExportOnlyData = true;

    grdResults.ExportSettings.IgnorePaging = false;

    grdResults.ExportSettings.OpenInNewWindow = true;

    grdResults.MasterTableView.ExportToExcel();

    }

    protected void lbExportAll_Click(object sender, EventArgs e)

    {

    //grdResults.PageSize = grdResults.MasterTableView.VirtualItemCount;

     

     

     

    grdResults.ExportSettings.ExportOnlyData = true;

    grdResults.ExportSettings.IgnorePaging = true;

    grdResults.ExportSettings.OpenInNewWindow = true;

    grdResults.MasterTableView.ExportToExcel();

    }

    }


  6. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 12 Dec 2008 Link to this post

    Hello Chris,

    The behavior you are experiencing is due to the use of SmartPart. This webpart will instantiate the usercontrol in its CreateChildControls method, however this method usually will be executed in prerender phase of page's life-cycle on page's initial load. Unfortunately in order to function correctly when used in Moss environment, RadAjaxManager and RadAjaxPanel should be registered in the Init phase of the page's life-cycle, which in your scenario is will not happen when page is first loaded. 

    In order to workaround this limitation you may try adding a RadAjaxManager instance to the masterpage and use a RadAjaxManagerProxy control inside your user control. Or you may consider subclassing the AjaxSmartPart webpart and override its onInit method to dynamically add the RadAjaxManager's instance. If you choose to take the later approach you may refer to this help article for details of how to register RadAjaxManager in Moss.

    Regards,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Chris
    Chris avatar
    58 posts
    Member since:
    Jun 2012

    Posted 16 Dec 2008 Link to this post

    Hi Rosen,
         thanks for the info. I have put an AJAX Manger on the masterpage on my dev server and have added an Ajax manger proxy control to my usercontrol. I have set this up ( I think I have done it right !!) and I have changed the Ajax panel to a regular asp:panel. Once again the ajax works corerctly in a normal environent but is still the same in the sharepoint environment. I'm sure its just me being a bit thick about setting up the ajax manager. I have posted the code below. I haven't chnaged the c# codebehind at all. I wasn't sure if i needed to do something in the OnInit event ??

    Any advice would be gratefully recieved.

    Thanks

    Chris.

    Updated Code :

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ParentalEmails2.ascx.cs" Inherits="usercontrols_ParentalEmails2" %>

    <%@ Register assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"

    namespace="Telerik.Web.UI" tagprefix="telerik" %>

     

    <

    telerik:RadAjaxManagerProxy runat="server" ID="rampChild">

     

    <AjaxSettings>

     

    <telerik:AjaxSetting AjaxControlID="ddlYearGroup">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="pnlCommonList"

    LoadingPanelID="alpMain"/>

     

    <telerik:AjaxUpdatedControl ControlID="dsEmails" />

     

    <telerik:AjaxUpdatedControl ControlID="dsSets" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    <telerik:AjaxSetting AjaxControlID="ddlHouse">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="pnlCommonList"

    LoadingPanelID="alpMain" />

     

    <telerik:AjaxUpdatedControl ControlID="dsEmails" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    <telerik:AjaxSetting AjaxControlID="ddlGender">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="pnlCommonList"

    LoadingPanelID="alpMain" />

     

    <telerik:AjaxUpdatedControl ControlID="dsEmails" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    <telerik:AjaxSetting AjaxControlID="ddlPupilType">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="pnlCommonList"

    LoadingPanelID="alpMain"/>

     

    <telerik:AjaxUpdatedControl ControlID="dsEmails" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    <telerik:AjaxSetting AjaxControlID="ddlSubject">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="pnlCommonList"

    LoadingPanelID="alpMain"/>

     

    <telerik:AjaxUpdatedControl ControlID="dsSubjects" />

     

    <telerik:AjaxUpdatedControl ControlID="dsEmails" />

     

    <telerik:AjaxUpdatedControl ControlID="dsSets" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    <telerik:AjaxSetting AjaxControlID="ddlSets">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="pnlCommonList"

    LoadingPanelID="alpMain"/>

     

    <telerik:AjaxUpdatedControl ControlID="dsEmails" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    </AjaxSettings>

     

    </

    telerik:RadAjaxManagerProxy>

     

    <

    telerik:RadAjaxLoadingPanel Runat="server" height="75px" width="75px"

    ID="alpMain" Transparency="40" BackColor="White"

    HorizontalAlign="Center" >

     

    <br />

     

    <br />

     

    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'

     

    style="border: 0px;" />

     

    </

    telerik:RadAjaxLoadingPanel>

     

    <

    asp:Panel ID="pnlCommonList" runat="server">

     

    <span class="ec-smartpart">

     

    <table ID="table1" runat="server" height="99%" width="80%">

     

    <tr >

     

    <td valign="middle" align="left" width="12%">

     

    <span class="ec-supplementaryfilter">

     

    <asp:Label ID="Label2" runat="server">YearGroup: </asp:Label><br />

     

    <asp:DropDownList ID="ddlYearGroup" runat="server" AutoPostBack="True"

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

    <asp:ListItem Text="All Years" Value="%" Selected="True" />

    <asp:ListItem Text="Year 9" Value="9" />

    <asp:ListItem Text="Year 10" Value="10"/>

    <asp:ListItem Text="Year 11" Value="11" />

    <asp:ListItem Text="Lower Sixth" Value="12" />

    <asp:ListItem Text="Upper Sixth" Value="13" />

    </asp:DropDownList>

     

    </span>

    </td>

     

    <td rowspan="6" height="100%" valign="top">

     

    <asp:Label ID="Label8" runat="server">E-mail Bcc list: </asp:Label><br />

     

    <asp:TextBox align="left" height="97%" Width="99%" ID="txtResult"

    runat="server" TextMode="MultiLine"></asp:TextBox>

     

    </td>

     

    </tr>

     

    <tr >

     

    <td valign="middle" align="left" width="12%">

     

    <span class="ec-supplementaryfilter">

     

    <asp:Label ID="Label1" runat="server" >House: </asp:Label><br />

     

    <asp:DropDownList ID="ddlHouse" runat="server" AutoPostBack="True"

     

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

    <asp:ListItem Text="All Houses" Value="%" Selected="True" />

    <asp:ListItem Text="Blackwater" Value="B" />

    <asp:ListItem Text="Craig" Value="C"/>

    <asp:ListItem Text="Gonville" Value="G" />

    <asp:ListItem Text="Nugent" Value="N" />

    <asp:ListItem Text="Pennell" Value="P" />

     

    <asp:ListItem Text="Powell" Value="Pw" />

    <asp:ListItem Text="Reeves" Value="R" />

    <asp:ListItem Text="School" Value="S" />

    <asp:ListItem Text="Wargrave" Value="W" />

    <asp:ListItem Text="Watt" Value="Wt" />

    </asp:DropDownList>

     

    </span>

    </td>

     

    </tr>

     

    <tr >

     

    <td valign="middle" align="left" width="12%">

     

    <span class="ec-supplementaryfilter">

     

    <asp:Label ID="Label3" runat="server" >Gender: </asp:Label><br />

     

    <asp:DropDownList ID="ddlGender" runat="server" AutoPostBack="True"

     

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

    <asp:ListItem Text="All Genders" Value="%" Selected="True" />

    <asp:ListItem Text="Male" Value="M" />

    <asp:ListItem Text="Female" Value="F"/>

    </asp:DropDownList>

     

    </span>

    </td>

     

    </tr>

     

    <tr >

     

    <td valign="middle" align="left" width="12%">

     

    <span class="ec-supplementaryfilter">

     

    <asp:Label ID="Label5" runat="server" >Pupil Type: </asp:Label><br />

     

    <asp:DropDownList ID="ddlPupilType" runat="server" AutoPostBack="True"

     

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

    <asp:ListItem Text="All Types" Value="%" Selected="True" />

    <asp:ListItem Text="Boarder" Value="Y" />

    <asp:ListItem Text="Day" Value="N"/>

    </asp:DropDownList>

     

    </span>

    </td>

     

    </tr>

     

    <tr >

     

    <td valign="middle" align="left" width="12%">

     

    <span class="ec-supplementaryfilter">

     

    <asp:Label ID="Label4" runat="server" >Subject: </asp:Label><br />

     

    <asp:DropDownList ID="ddlSubject" runat="server" AppendDataBoundItems="true"

    DataTextField="description" DataValueField="code"

    DataSourceID="dsSubjects" AutoPostBack="True"

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

    <asp:ListItem Text="All Subjects" Value="%" Selected="True" />

    </asp:DropDownList>

     

    </span>

    </td>

     

    </tr>

     

    <tr >

     

    <td valign="middle" align="left" width="12%">

     

    <span class="ec-supplementaryfilter">

     

    <asp:Label ID="Label7" runat="server" >Set: </asp:Label><br />

     

    <asp:DropDownList ID="ddlSets" runat="server" AppendDataBoundItems="true"

    DataTextField="description" DataValueField="code"

    DataSourceID="dsSets" AutoPostBack="True"

    onselectedindexchanged="ddl_SelectedIndexChanged">

     

    <asp:ListItem Text="All Sets" Value="%" Selected="True" />

    </asp:DropDownList>

     

    </span>

    </td>

     

    </tr>

     

    <tr visible="false">

     

    <td valign="middle" style="padding:6px,1px,6px,1px !important">

     

    <asp:LinkButton ID="lbExportPage" runat="server" CssClass="metisLinkButton"

    onclick="lbExportPage_Click">

     

    Export Page to Excel

    </asp:LinkButton>

     

    </td>

     

    <td valign="middle" style="padding:6px,1px,6px,1px !important">

     

    <asp:LinkButton ID="lbExportAll" runat="server" CssClass="metisLinkButton"

    onclick="lbExportAll_Click">

     

    Export All to Excel

    </asp:LinkButton>

    </td>

     

    </tr>

     

    <tr >

     

    <td valign="top" align="left" colspan="2">

     

    <asp:Label ID="Label6" runat="server" >Results: </asp:Label><br />

     

    <telerik:RadGrid runat="server" ID="grdResults" AllowPaging="True"

    AllowSorting="True" AllowFilteringByColumn="True"

    height="100%" GridLines="None"

    PageSize="150" DataSourceID="dsEmails"

    ondatabound="grdResults_DataBound" onitemcreated="grdResults_ItemCreated"

     

    ShowStatusBar="True" AllowMultiRowSelection = "True"

    Skin="Sunset" >

     

     

    <MastertableView>

     

    <norecordstemplate>

     

    No Email Addresses Found.

    </norecordstemplate>

     

    <RowIndicatorColumn>

     

    <HeaderStyle width="20px"></HeaderStyle>

     

    </RowIndicatorColumn>

     

    <ExpandCollapseColumn>

     

    <HeaderStyle width="20px"></HeaderStyle>

     

    </ExpandCollapseColumn>

     

    <Columns>

     

    <telerik:GridTemplateColumn uniquename="CheckBoxTemplateColumn" AllowFiltering="false">

     

    <ItemTemplate>

     

    <asp:CheckBox ID="chkSelected" runat="server" AutoPostBack="true"

    Checked="true" OnCheckedChanged="ToggleRowSelection" />

     

    </ItemTemplate>

     

    <HeaderTemplate>

     

    Hide

    </HeaderTemplate>

     

    </telerik:GridTemplateColumn>

     

    </Columns>

     

    <editformsettings>

     

    <editcolumn cancelimageurl="Cancel.gif" editimageurl="Edit.gif"

    insertimageurl="Update.gif" updateimageurl="Update.gif">

     

    </editcolumn>

     

    </editformsettings>

     

    </MastertableView>

     

    <exportsettings exportonlydata="True" openinnewwindow="True">

     

    </exportsettings>

     

    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Position="TopAndBottom" />

    <clientsettings allowcolumnsreorder="True" reordercolumnsonclient="True">

     

    </clientsettings>

     

    <filtermenu enabletheming="True">

     

    <collapseanimation duration="200" type="OutQuint" />

     

    </filtermenu>

     

    <headercontextmenu enabletheming="True">

     

    <collapseanimation duration="200" type="OutQuint" />

     

    </headercontextmenu>

     

    </telerik:RadGrid>

    </td>

     

    </tr>

     

    </table>

     

    </span>

     

    </

    asp:Panel>

     

    <

    asp:SqlDataSource ID="dsSubjects" runat="server" SelectCommand="usps_GetListBoxData"

    SelectCommandType="StoredProcedure" DataSourceMode="DataSet" >

     

    <SelectParameters>

     

    <asp:Parameter Name="listBoxType" DefaultValue="SUBJECTS"/>

     

    </SelectParameters>

     

    </

    asp:SqlDataSource>

     

    <

    asp:SqlDataSource ID="dsEmails" runat="server" SelectCommand="usps_GetParentalEmailList"

     

    SelectCommandType="StoredProcedure" DataSourceMode="DataSet"

    onselecting="dsEmails_Selecting" >

     

    <SelectParameters>

     

    <asp:Parameter Name="YearGroup" DefaultValue="INIT"/>

     

    <asp:Parameter Name="House" DefaultValue="INIT"/>

     

    <asp:Parameter Name="Gender" DefaultValue="INIT"/>

     

    <asp:Parameter Name="Subject" DefaultValue="INIT"/>

     

    <asp:Parameter Name="PupilType" DefaultValue="INIT"/>

     

    <asp:Parameter Name="SetCode" DefaultValue="INIT"/>

     

    </SelectParameters>

     

    </

    asp:SqlDataSource>

     

    <

    asp:SqlDataSource ID="dsSets" runat="server" SelectCommand="usps_GetSetListBoxData"

     

    SelectCommandType="StoredProcedure" DataSourceMode="DataSet"

    onselecting="dsSets_Selecting" >

     

    <SelectParameters>

     

    <asp:Parameter Name="YearGroup" DefaultValue="INIT"/>

     

    <asp:Parameter Name="SubjectCode" DefaultValue="INIT"/>

     

    </SelectParameters>

     

    </

    asp:SqlDataSource>

     


    using

    System;

    using

    System.Text;

    using

    System.Threading;

    using

    System.Web.UI;

    using

    System.Web.UI.WebControls;

    using

    EastbourneCollege.Global;

    using

    Telerik.Web.UI;

    public

    partial class usercontrols_ParentalEmails2 : UserControl

     

    {

    private void EnsureUpdatePanelFixups()

    {

    if (this.Page.Form != null)

    {

    string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];

    if (formOnSubmitAtt == "return _spFormOnSubmitWrapper();")

    {

    this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";

    }

    }

    ScriptManager.RegisterStartupScript(this, typeof(usercontrols_ParentalEmails2),

    "UpdatePanelFixup", "_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;", true);

    }

    protected override void CreateChildControls()

    {

    base.CreateChildControls();

    this.EnsureUpdatePanelFixups();

    dsSubjects.ConnectionString = Constants.ConnectionString;

    dsEmails.ConnectionString = Constants.ConnectionString;

    dsSets.ConnectionString = Constants.ConnectionString;

    txtResult.Attributes.Add("onfocus", "select();");

    }

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void ToggleRowSelection(object sender, EventArgs e)

    {

    ((sender as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;

    //update email list in text box

     

    CreateOutlookEmailList();

    }

    protected void dsEmails_Selecting(object sender, SqlDataSourceSelectingEventArgs e)

    {

    //add new values for select params

     

    e.Command.Parameters["@YearGroup"].Value = ddlYearGroup.SelectedValue;

    e.Command.Parameters["@House"].Value = ddlHouse.SelectedValue;

    e.Command.Parameters["@Gender"].Value = ddlGender.SelectedValue;

    e.Command.Parameters["@Subject"].Value = ddlSubject.SelectedValue;

    e.Command.Parameters["@PupilType"].Value = ddlPupilType.SelectedValue;

    e.Command.Parameters["@SetCode"].Value = ddlSets.SelectedValue;

    }

    protected void dsSets_Selecting(object sender, SqlDataSourceSelectingEventArgs e)

    {

    //add new values for select params

     

    e.Command.Parameters["@YearGroup"].Value = ddlYearGroup.SelectedValue;

    e.Command.Parameters["@SubjectCode"].Value = ddlSubject.SelectedValue;

    }

    protected void grdResults_DataBound(object sender, EventArgs e)

    {

    CreateOutlookEmailList();

    }

    private void CreateOutlookEmailList()

    {

    StringBuilder sb = new StringBuilder();

    foreach (GridDataItem r in grdResults.Items)

    {

    if (r.Selected) continue;

    string val = r.Cells[(r.Cells.Count - 1)].Text;

     

    //only add if not in the list already

     

    if(! sb.ToString().Contains(val))

    {

    sb.Append(val + "; ");

    }

    }

    txtResult.Text = sb.ToString();

    txtResult.Focus();

    }

    protected void grdResults_ItemCreated(object sender, GridItemEventArgs e)

    {

    if (e.Item is GridDataItem)

    {

    e.Item.PreRender += Item_PreRender;

    }

    if (e.Item is GridFilteringItem)

    {

    GridFilteringItem filteringItem = e.Item as GridFilteringItem;

    //set dimensions for the filter textbox

     

    TextBox box = filteringItem["Relationship"].Controls[0] as TextBox;

    box.Width = Unit.Pixel(45);

    }

    }

    private void Item_PreRender(object sender, EventArgs e)

    {

    try

     

    {

    ((sender as GridDataItem)["CheckBoxTemplateColumn"].FindControl("chkSelected") as CheckBox).Checked =

     

    (sender as GridDataItem).Selected;

    }

    catch

     

    {

    }

    }

    protected void ddl_SelectedIndexChanged(object sender, EventArgs e)

    {

    string ddlID = (sender as DropDownList).ID;

     

    //filter the set list for the chosen YG and subhect code

     

    if (ddlID == "ddlSubject" || ddlID == "ddlYearGroup")

    {

    ddlSets.Items.Clear();

    ddlSets.Items.Add(new ListItem("All Sets","%"));

    ddlSets.DataBind();

    }

    grdResults.DataBind();

    }

    protected void lbExportPage_Click(object sender, EventArgs e)

    {

    //grdResults.PageSize = grdResults.MasterTableView.VirtualItemCount;

     

    grdResults.ExportSettings.ExportOnlyData = true;

    grdResults.ExportSettings.IgnorePaging = false;

    grdResults.ExportSettings.OpenInNewWindow = true;

    grdResults.MasterTableView.ExportToExcel();

    }

    protected void lbExportAll_Click(object sender, EventArgs e)

    {

    //grdResults.PageSize = grdResults.MasterTableView.VirtualItemCount;

     

    grdResults.ExportSettings.ExportOnlyData = true;

    grdResults.ExportSettings.IgnorePaging = true;

    grdResults.ExportSettings.OpenInNewWindow = true;

    grdResults.MasterTableView.ExportToExcel();

    }

    }





  8. Chris
    Chris avatar
    58 posts
    Member since:
    Jun 2012

    Posted 16 Dec 2008 Link to this post

    Rosen,
     sorry forgot to post the code from the masterpage :

    <%@Master language="C#"%>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
    <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2008.3.1105.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
    <HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
    <HEAD runat="server">
     <META Name="GENERATOR" Content="Microsoft SharePoint">
     <META Name="progid" Content="SharePoint.WebPartPage.Document">
     <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
     <META HTTP-EQUIV="Expires" content="0">
     <SharePoint:RobotsMetaTag runat="server"/>
     <Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
     <SharePoint:CssLink runat="server"/>
     <SharePoint:Theme runat="server"/>
     <SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
     <SharePoint:CustomJSUrl runat="server"/>
     <SharePoint:SoapDiscoveryLink runat="server"/>
     <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
     <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
    </HEAD>
    <BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
      <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
     <WebPartPages:SPWebPartManager id="m" runat="Server"/>
     <asp:ScriptManager runat="server" ID="ScriptManager1" />
     <telerik:RadAjaxManager ID="ramMain" runat="server"></telerik:RadAjaxManager>
      <TABLE class="ms-main" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT="100%">
  9. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 16 Dec 2008 Link to this post

    Hi Chris,

    Can you please try adding ajaxsetting inside usercontrol's PreRender event instead declaratively, similar to the following:

    protected override void OnPreRender(EventArgs e)  
        {  
            base.OnPreRender(e);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlYearGroup, pnlCommonList, alpMain);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlYearGroup, dsEmails);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlYearGroup, dsSets);  
     
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlHouse, pnlCommonList, alpMain);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlHouse, dsEmails);  
     
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlGender, pnlCommonList, alpMain);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlGender, dsEmails);  
     
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlPupilType, pnlCommonList, alpMain);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlPupilType, dsEmails);  
     
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlSubject, pnlCommonList, alpMain);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlSubject, dsEmails);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlSubject, ddlSubject);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlSubject, dsSets);  
     
     
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlSets, pnlCommonList, alpMain);  
            RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ddlSets, dsEmails);  
        } 

    Please give it a try and let us know if this helps.

    Kind regards,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Chris
    Chris avatar
    58 posts
    Member since:
    Jun 2012

    Posted 17 Dec 2008 Link to this post

    Hi Rosen,
        you are a star !!!!!! works like a dream now. Thank you so much for all your help. I think with the popularity of Sharepoint on the increase and also the increased popularity of Return of smartPart v1.3 (with AJAX) it might be prudent to create a guide or smaple for other developers out there. You are welcome to use this code if you wish as an example.

    Once again thank you very much.

    Chris
  11. Rosen
    Admin
    Rosen avatar
    3235 posts

    Posted 18 Dec 2008 Link to this post

    Hi Chris,

    I'm glad that you have managed to solve the issue you were facing.

    Thank you for your suggestion, indeed we will consider adding an example of how to use SmartPart and RadAjaxManager in MOSS environment.

    Best regards,
    Rosen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top