We are attempting to add a WebScheduleInfo control to our pages and are running into some problems with Content pages. We can successfully add all the required controls and access the SqlServer database from standalone aspx pages. But any attempts to add those exact same controls to a Master page results in a timed out connection to the database. Below are two example aspx pages.
testNoMaster.aspx. This sample works correctly, connects to the database and dispalys appointments for the current month.
<%@ Register Assembly="Infragistics35.WebUI.WebSchedule.v8.1, Version=8.1.20081.2033, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
<%@ Register Assembly="Infragistics35.WebUI.WebScheduleDataProvider.v8.1, Version=8.1.20081.2033, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.WebUI.Data" TagPrefix="ig_scheduledata" %>
<head runat="server">
<body>
<form id="form1" runat="server">
<div>
SelectCommand=";"></asp:SqlDataSource>
<ig_scheduledata:WebScheduleSqlClientProvider ID="WebScheduleSqlClientProvider1"
WebScheduleInfoID="WebScheduleInfo1">
</ig_scheduledata:WebScheduleSqlClientProvider>
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server">
</igsch:WebScheduleInfo>
</igsch:WebMonthView>
</div>
</html>
This page times out when attempting to connect to the database. The controls in the content pane are a direct copy from the page above that works correctly.
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
Can anyone point me to a solution to this problem. If we can not find one we will most likely be finding some other controls to purchase instead.
Andrew Taft
Great point, thank you!
Be careful and do not hard code the name in the HTML because it will change in Firefox. Firefox and IE interpret the child control IDs differently. It is better to use the assignemnt in the server code behind rather than hard coding it in the HTML
I get that WebscheduleSQLClientProvider does not contain a definition for DataSource. Intellisense only gives me DataSourceID.
Just got the answer from Infragistics:
DataSourceID="ctl00$ContentPlaceHolder1$SqlDataSource1"
or
this.WebScheduleSqlClientProvider1.DataSourceID = this.SqlDataSource1.ID;
Since the controls are in a master page, all controls are "munged" by their naming container so SqlDataSource1 becomes MasterPageName$SqlDataSource1, etc. Consequently, the recommendation is that all controls being wired-up by their IDs (because their IDs are going to change on a master page or user control) should be assigned through code-behind.
So instead of using DataSourceID, you want to assign,
WebScheduleSqlClientProvider1.DataSource = SqlDataSource1
This one in particular is probably what's causing your particular message, because it sounds like the data provider is trying to create its own default DB connection instead of using the one you have set-up with integrated security in the data source control, and it would only do this if it couldn't find the data source control. Nonetheless, it's important to do this for connecting anything that had been connected via ID when using master pages.
I tried this solution and it did not work. Mine gives me a login failed for sa but our connection string is using integrated security and it works fine if i take it out of a master page. Suggestions?