Cannot Add User Control to AJAX Toolkit TabContainer - ajax

I have a user control called "Request" that I am able to display outside of a TabContainer on my SharePoint 2010 application page. So the following works:
<UserControl:Request ID="Request1" runat="server" />
<Ajax:TabContainer ID="TabContainer1" runat="server" ScrollBars="None" Enabled="true">
<Ajax:TabPanel ID="TabPanel1" runat="server" HeaderText="Request">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label">Mylabel</asp:Label>
</ContentTemplate>
</Ajax:TabPanel>
</Ajax:TabContainer>
However, if I merely move the UserControl line into the ContentTemplate section, replacing the existing Label control, the page bombs out with a runtime error and "Request failed".

The workaround for me was to COPY, not MOVE, the user control into the ContentTemplate section, then give the copy a different ID and set the original (which I don't need) to visible="false". I have no idea why this works and it looks like a bug to me. If anyone can explain it, please do so...

Related

Radlistbox enable/disable checkbox VB.NET

I need help with disabling only the checkboxs in RadListBox
can someone show me how to do it please.(VB.NET)
aspx.code:
<telerik:RadListBox ID="rlbNavigateIncidents" runat="server" AutoPostBack="True" CheckBoxes="True" ShowCheckAll="False" Width="239px" Height="315px">
</telerik:RadListBox>

Telerik control events always being triggered

I'm using the Telerik combo box to create cascading multi-select drop down lists.
I have several drop down lists on the page ddlProject, ddlUnit, ddlDiscipline, ddlDocType.
I am using the Telerik RadAjaxManager to trigger the updates of the controls and the markup of this is as follows:
<telerik:RadAjaxManager ID="ajaxManager" runat="server" DefaultLoadingPanelID="lpnlLoading" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ddlProject" EventName="TextChanged">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ddlUnit" UpdatePanelRenderMode="Inline"/>
<telerik:AjaxUpdatedControl ControlID="ddlDiscipline" UpdatePanelRenderMode="Inline" />
<telerik:AjaxUpdatedControl ControlID="ddlDocType" UpdatePanelRenderMode="Inline" />
<telerik:AjaxUpdatedControl ControlID="ddlPhase" UpdatePanelRenderMode="Inline" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="ddlUnit" EventName="TextChanged" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ddlDocType" UpdatePanelRenderMode="Inline" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="ddlDiscipline" EventName="TextChanged">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="ddlDocType" UpdatePanelRenderMode="Inline" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
ddlProject updates ddlUnit, ddlDiscipline and ddlDocType.
ddlUnit and ddlDiscipline are only meant to update ddlDocType but I am finding that the TextChanged event is being fired when either of these controls is changed.
I've tried commenting out the Ajax Manager to see if ddlProject_TextChanged is being called and it's not, only when the Ajax Manager is on the page. I would like the Ajax Manager to be enabled to suppress the page postbacks plus it displays a loading panel for each of the comb boxes which I think gives good user experience showing when they are loading.
All this is within a user control because I want to use it on multiple pages.
Can someone please help with a solution to stop ddlProject_TextChanged being fired when unit and discipline are changed?
Thanks in advance
Andy
Edit:
I've just discovered that it might not be the AjaxManager. The control events seem to be getting fired every time the page does a post back. I also have a standard ASP.NET button which on click does not databind to any of the checkboxes, it just processes the selected values in the user control. It's even external to the user control which contains the combo boxes.
Combobox structure:
<telerik:RadComboBox ID="ddlUnit" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true"
MaxHeight="450px" Width="300px" DataTextField="Value" DataValueField="Key" Label="Unit:"
LabelCssClass="HeaderLabel" DropDownWidth="600px" Height="400px"
AutoPostBack="true" OnTextChanged="ddlUnit_TextChanged">
</telerik:RadComboBox>
TextChanged event
protected void ddlDiscipline_TextChanged(object sender, EventArgs e)
{
CTRmDataService ctrmDS = new CTRmDataService();
this.ddlDocType.DataSource = ctrmDS.GetDocumentTypesForProjectsDisciplineAndUnit(GetSelectedProjects(),
GetSelectedDisciplines(),
GetSelectedUnits(),
LoggedOnUser.Id);
this.ddlDocType.DataBind();
}
I've just been informed by Telerik that this is a bug and has been passed over to their development team.
Not necessarily a working answer but explains why I'm having the problems.
Not sure this will help at all but in our instance the issue was down to the IIS server caching content that has an adverse effect on Telerik controls. It only became apparent to us when we switched out web.config settings from debug="true" to debug="false" as this then allowed IIS to enable its caching and other related optimizations, turning all caching off in the browser for some reason still broke the controls, however turning it off in IIS or turning it back onto debug mode solved it.

ASP Menu 4.0 AJAX client failed to load

I have a simple ASP.NET 4.0 site (no MVC). Just a Master page containing header, menu and footer. I added the script manager in the Master page too. The menu is an ASP.NET Menu control. Everything is OK on my development machine, but as soon as I move it to the GoDaddy server, the menu stops working. This is a dynamic menu loaded from a sitemap.
My problem is that the first time I load it, it just doesn't work. I always get an 'AJAX client-side framework failed to load error' and the "hover" doesn't work. But as soon as I click on one menu item, it changes the page and everything works fine afterward.
I tried a lot of things that I found here and there on the Internet. I put an EnablePartialRendering="True" to my ScriptManager, I added some code to manage ".axd" html handlers. But none of that seems to work.
Here's the code for the menu (test not final so still messy) :
<asp:Menu ID="mnuGauche" runat="server" DataSourceID="sitemap" BackColor="Transparent" RenderingMode="Table"
DynamicHorizontalOffset="0" Font-Names="Arial Black" Font-Size="small"
ForeColor="#7C6F57" Width="100%" Height="20px"
style="margin-left: 0px" Orientation="Horizontal" StaticEnableDefaultPopOutImage="false">
<StaticSelectedStyle BackColor="#5D7B9D" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle CssClass="MenuDynamique" />
<DynamicSelectedStyle BackColor="#5D7B9D" ForeColor="White" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Font-Size="small" />
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
</asp:Menu>
In my Web.config file, the only thing special that I have is :
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Altough there's plenty of stuff on the web, nothing seems to really work for this menu control. Wich is kind of bizarre because it's one from Microsoft themself. Can anyone help me on that one ?

ASP.Net MVC 3 Razor Create Report

I have ASP.Net MVC3 project with Razor template, and I need to make a reporting tool for summary reports and detailed reports.
I do not know how to create such reports in MVC3. Could anyone give me an example for creating these reports?
There isn't a built-in control for reports, there is however an HTML helper for displaying charts. Please see example here
SSRS reports are not supported by default in MVC 3, therefore you need to use a report viewer control. Article explaning how to do this can be found here
first, i must configure the dataset in my project. because i use storedprocedure, so i must add new table adapter in my dataset.
then i add new item (for the report file) in my project and design the report using report wizard.
after that, for showing the report in my project, i add new web form and in my web form, drag the report viewer and script manager. choose the design view to set up the report.
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" SizeToReportContent="true"
Font-Size="8pt" InteractiveDeviceInfos="(Collection)"
WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
<LocalReport ReportPath="Reports\rptbooking.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="rptBatchClose.RDYGetawayDataSetTableAdapters.DataTable1TableAdapter">
</asp:ObjectDataSource>
</div>
</form>
</body>
this is the simple way to make SSRS report in my MVC3 Project.

Firefox not rendering contents of a Update panel

Why does the following code perform a partial render in IE but not in FF?
In FF, the time on the outside of the updatepanel will also refresh, not so in IE.
<form id="form1" runat="server">
<div>
<%=DateTime.Now.ToLongTimeString() %>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<p>New time is <%=DateTime.Now.ToLongTimeString() %></p>
<asp:Button ID="Button1" runat="server" Text="Go get it" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>
</form>
Can I know what version of Firefox you are using?
I tested this on Firefox 3.0 and Firefox 3.5 (clean install - no addons).
If I click the button only the new time refreshes, the outer time doesn't. So the partial rendering works.
If you are on Firefox 3.0 or 3.5 can you create a new firefox profile to test this?.
Oleg's comment about the EventName attribute on the AsyncPostBackTrigger is likely correct. However, I would add that the Triggers do not need to be explicitly defined in this case since the Button is contained in the UpdatePanel. Events from contained elements trigger the Async Postback by default so it's unnecessary.
You've got javascript disabled in FF and it's performing a full postback. :-)

Resources