Created an aspx pageCopied WebSchedule2.mdb to App_Data folder as instructedAdded Access Data SourceConfigured data source - ~/App_Data/WebSchedule2.mdbFollowed all instructions in "Connecting WebSchedule to a Database in Visual Studio 2005"
Followed instructions in "Using the WebSchedule Controls Quick Design"Added WebScheduleInfoAdded WebScheduleOldDbProviderSet DataSourceId to AccessDataSource1Added WebCalendarViewAdded WebDayViewAdded WebMonthViewSet WebScheduleInfoId to WebScheduleInfo1 for all threeOpened WebSchedule2.mdb and added 3 activitiesViewed page in browserClicked on dates where I added activites. Nothing displaysSuddenly I'm getting the following error
Line 13: DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand=";"></asp:AccessDataSource>Line 14: Line 15: <igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" Line 16: DataFetch="WebScheduleOleDbProvider1" DataUpdate="WebScheduleOleDbProvider1" Line 17: StyleSetName="" StyleSetPath="" StyleSheetDirectory="">
Sometimes when adding controls it claims there are duplicates when there are no duplicates. Eventually this error goes away.
What am I doing wrong?
Also, are there instructions on how to maintain the WebSchedule2.mdb Access Database? Assuming I get it to work.
Thanks
I'm not sure I was 100% clear with the error I'm getting. Here is additional information.
Error Creating Control - WebScheduleInfo1 Cannot create an object of type 'Infragistics.WebUI.WebSchedule.IDataFetch' from its string representation 'WebScheduleOleDbProvider1' for the 'DataFetch' property.
Thanks, Jim
Also, As soon as I make any type of change I get the following error on everey one of these controls.
"Duplicate Component Name" But when I do a search I don't have any duplicates. Eventually this error goes away, sometimes when I close Visual Studio and open it back up. Very strange.
Hi Steve,
I found the answer why it is displaying different appointments in my page. I suspect it may not be an Infragistics problem but so far I have not figured out how to fix it.
I’m almost there and I know you are going beyond to help me what anyone would expect.
I started over with a clean CherryHillFirst project and deleted all the pages referencing WebSchedule2.mdb and also deleted WebSchedule2.mdb from App_Data.
I then copied WebSchedule2.mdb from c:\Users\Public\Public documents\Infragistics\NetAdvantage 2010.3\ASP.NET\WebSchedule\Data\WebSchedule2.mdb
I then opened the above database in my project and to my surprise there were 2 appointments in there. They were the ones that were displayed in my page but not in the page from WebScheduleTesting. I somehow must have added them when trying to get this to work. So I deleted them in WebSchedule2.mdb in App_Data but not in C:\Users … and then created a new Calendar page following all the instructions you gave me.
Everything worked except it appears that it is connecting to the WebSchedule2.mdb in C:\Users … and not to the one in App_Data, because the 2 appointments are there, or maybe it is connecting to another one somewhere in my computer. I have no idea why this is happening. Same thing happens on my laptop when I copy the project to the laptop. I tried it in IE, FireFox and Chrome. All are the same.
This is from the new page I created.
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand="SELECT * FROM [Activity]">
</asp:AccessDataSource>
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" StyleSetName=""
StyleSetPath="" StyleSheetDirectory="">
</igsch:WebScheduleInfo>
<ig_scheduledata:WebScheduleOleDbProvider ID="WebScheduleOleDbProvider1"
runat="server" WebScheduleInfoID="WebScheduleInfo1">
</ig_scheduledata:WebScheduleOleDbProvider>
<div class="centerHdr">
<table>
<tr>
<td>
<igsch:WebCalendarView ID="WebCalendarView1" runat="server"
WebScheduleInfoID="WebScheduleInfo1">
</igsch:WebCalendarView>
</td>
<igsch:WebWeekView ID="WebWeekView1" runat='server'
Width="300px" WebScheduleInfoID="WebScheduleInfo1">
</igsch:WebWeekView>
</tr>
</table>
All the References seem to be correct and this is from my Web.config
<infragistics.web styleSetName="Default" styleSetPath="~/ig_res" formsDirectory="~/WebSchedule" />
There are 3 assemblies in WebScheduleTesting that I don’t have so I copied them into my assemblies but it didn’t help.
They are WebDataChooser, UltraWebTab and UltraWebToolbar
I tried adding DataSourceID=”AccessDataSource1” to WebScheduleOleDBProvider but it doesn’t help.
I also have these 2 Connections Strings but I think I need them for ASPNETDB.MDF
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=TECH003\SQLEXPRESS;Integrated Security=SSPI; AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
<add name="ASPNETDBEntities"
connectionString="metadata=res://*/Images.csdl|res://*/Images.ssdl|res://*/Images.msl;provider=System.Data.SqlClient;provider connection string="Data Source=TECH003\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/>
I then copied ScheduleForm.aspx from WebScheduleTesting into CherryHillFirst and viewed in browser. It opened and connected to the correct database in App_Data and did not display the 2 appointments that I’m getting in my calendar page.
I have other pages in my project and use a MasterPage with an Infragistics menu. Maybe there is something strange going on in the MasterPage since ScheduleForm is not using the MasterPage.
I’ll keep working on it. One of my friends is very good at Visual Studio and databases. Maybe he will see something if I can’t find it. But he lives an hour away and I don’t see him often.
Jim
Hey Jim,
Don't worry, we will get this working.
One thing, you will definately need to set the DataSourceID on the WebScheduleOleDbProvider which points to the local mdb file in App_Data. That is how it knows where to find the file. Otherwise, it is hardcoded to go to the one that exists where the samples get installed. So if you dont have that DataSourceID set, it will always use the one local on your machine, not in your project.
Also, I have checked out the same process with having a master page thinking there might be a gotcha hidden in there, but it worked fine so I dont think master pages are giving you any problems.
However, now I am not sure what problems you are running into. Hopefully this helps. The code below works great. Make sure yours looks the same.
<%@ Page Title="" Language="C#" MasterPageFile="~/ScheduleMaster.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebScheduleTesting.WebForm1" %><%@ Register assembly="Infragistics4.WebUI.WebSchedule.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebSchedule" tagprefix="igsch" %><%@ Register assembly="Infragistics4.WebUI.WebScheduleDataProvider.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Data" tagprefix="ig_scheduledata" %><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <igsch:WebDayView ID="WebDayView1" runat="server" WebScheduleInfoID="WebScheduleInfo1"> </igsch:WebDayView> <igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server"> </igsch:WebScheduleInfo> <ig_scheduledata:WebScheduleOleDbProvider ID="WebScheduleOleDbProvider1" runat="server" DataSourceID="AccessDataSource1" WebScheduleInfoID="WebScheduleInfo1"> </ig_scheduledata:WebScheduleOleDbProvider> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand="SELECT * FROM [Activity]"> </asp:AccessDataSource></asp:Content>
Also, if you want to clean up the connection strings, you can search the project for the name of the connection string and if you find it, then it is being used.
I confirmed that what I suspected is the problem. I renamed WebSchedule2.mdb in C:\Users\Public\Documents\Infragistics\NetAdvantage 2010.3\WebSchedule\Data\ to WebSchedule3.mdb. It then got a not found.
I then created a new project from scratch and got the same error. I'm still not connecting to the database in App_Data but to the one above. But the test page you have send me works correctly and I don't see anything different. Maybe thre is something strange going on in my Web.config but I don't see anything that would cause the problem.
I created a zip file and tried to attached it be it was too big but this Is from my aspx page
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CalendarMaint.aspx.cs" Inherits="CalendarTest2.CalendarMaint" %>
<%@ Register Assembly="Infragistics4.WebUI.WebScheduleDataProvider.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.Data" TagPrefix="ig_scheduledata" %>
<%@ Register Assembly="Infragistics4.WebUI.WebSchedule.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.WebSchedule" TagPrefix="igsch" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand="SELECT * FROM [Activity]"></asp:AccessDataSource>
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server"></igsch:WebScheduleInfo>
<ig_scheduledata:WebScheduleOleDbProvider ID="WebScheduleOleDbProvider1" runat="server" WebScheduleInfoID="WebScheduleInfo1" DataSourceID="AccessDataSource1"></ig_scheduledata:WebScheduleOleDbProvider>
<br /> <br /><table> <tr> <td> <igsch:WebCalendarView ID="WebCalendarView1" runat="server" WebScheduleInfoID="WebScheduleInfo1"> </igsch:WebCalendarView> </td>         <td> <igsch:WebWeekView ID="WebWeekView1" runat='server' EnableMultiResourceCaption="True" StyleSetName="" StyleSetPath="" StyleSheetDirectory="" Width="400px" WebScheduleInfoID="WebScheduleInfo1"> </igsch:WebWeekView> </td> </tr></table>
</div>
I feel both very appreciative and frustrated that you have spent so much time helping me. At this point I should be able to figure this out myself and not take so much of your time. Maybe I have something strange set in my verison of Visual Studio but then the page you have sent me works correctly and mind does not.
It must be something very simple that I just keep missing.
I'll keep working on it. I can't give up now that I'm so close.
Sorry, I fell for the same thing. When you are inside of the masterpage, the ID of AccessDataSource1 is not just AccessDataSource1. It has the parent container added to it. So, you can do two different things to get this to work. You can modify the aspx source code to the updated name
DataSourceID="ctl00$ContentPlaceHolder1$AccessDataSource1" instead of just DataSourceID="AccessDataSource1"
If you run the project and use the debugger, see what the ClientID property of AccessDataSource1 is and then just paste that into the DataSourceID property.
Or, you can do this via code behind and create an OleDB connection and assign it to the Connection property of the OleDbProvider.
OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|\WebSchedule2.mdb"; this.WebScheduleOleDbProvider1.Connection = conn;
With the code above, you dont need to set the DataSourceID property.
Use One of the two ways and you should be good. Then I think we got you going. Let me know how it goes.
Steve,
Thanks for all your patience with me. I now have it working. I'll spend the next few days creating a maintenance page and a view only page and report back.
You are probably getting tired of me by now but I’m getting close and don’t want to throw away all my effort and all your help by giving up.
I followed all your instructions and even have ig_res in my project. I have 2 pages, CalendarMaint.aspx (to update the calendar) and CalendarView.aspx (for view only). I only made the changes in CalendarView.aspx and then everywhere else that was not specific to either of those. I checked everything carefully and tested with FireFox, Chrome and IE8.
Both CalendarMaint and CalendarView work the same with all tests.
Here is what I get with Firefox
Get the Reminder popup when I open the page
Click on Open Item
Click on Save and Close
It doesn’t add anything but I get “Transferring data from local host” at the bottom of the popup page but nothing happens, so I close the popup
I then click on a date and it doesn’t open anything
With Chrome
I don’t get the Popup
Click on a date, nothing happens
With IE8
Got this error
Object expected AppointmentAdd.aspx?ReadOnly=true,line27 character 39
Line: 27
Error: Object expected
<body class="FormBackground" onload="AppointmentAddLoad()" style="overflow:hidden;PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px;
When I tested your project
In FireFox and IE8
No popup
Click on a date, popup opens
Save and close, nothing is saved and the popup closes
In Chrome
Nothing happens when I click on a date.
Maybe I still have MasterPage issues?
Ok. There are a few things to go over. I wanted you to handle the ActivityDialogOpening and ReminderDialogOpening ClientSideEvents of the ScheduleInfo control. The properties you are trying to set do not exist.
I attached my sample again so you can see it.
1). Look at the use of the ClientSideEvents of the ScheduleInfo control. This is how you stop the dialog from opening. Just handle the event and call oEvent.cancel = true.
2). Now to make it readonly, I gave you a function inside of the ig_addAppointmentDialogForm.js called DisableElements(); It gets called from the end of the InitializeValues function. Inside of DisableElements, I get all the controls on the page and set them to be disabled.
I inject a little markup into the page that tells me whether or not to disable the elements or not. Here is that line of code.
ClientScript.RegisterClientScriptBlock(this.GetType(), "ReadOnly", "<script>var IsDialogReadOnly=true;</script>");
You can do this however you want. This was just easy for me. I then check for that inside of the InitializeValues function to let me know whether or not I should call my diable function. I use the dialogInterface object which i get for free from using the schedule dialogs to get back to the opener window so I can ge the javascript I injected on that page.
if (dialogInterface._openerWindow.window.IsDialogReadOnly) { DisableElements(); }
Thats it. Now all elements are disabled. Check out the sample. Add an ig_res folder to the project so you have some styling. That folder is too big to attach.
Todd helped me so no problem that you were called away. I should have remembered to fix the build on my own anyway.
The one page I have is ok. I will either not put it in the menu or password protect it or both so only a few people can make updates.
I’m not sure yet for the view only if I will be using several controls such as the WebCalendarView and WebMonthView or some other one in a view only page or just use the WebCalendarView on the home page. I’m going to have 2 sites where I use this and each may want something a little different. But I think either way they should work the same.
I think the cleanest thing would be to not popup the dialog when logging on or opening the view page but just see the control(s) and then be able to click on a day (bolded in the WebCalendarView if there is something there) or a day in the WebMonthView so they can get the popup to see the details but not let them update anything. I suppose it would be nicer not to let them enter anything but disabling the save button would be ok as well if that is easier. Of course they can still click on an empty day as long as they cannot update anything.
I tried adding the ActivityDialogEvent and ReminderDialogOpening and I still get the Reminder popup when opening the page. I would prefer not to have it automatically popup, especially if I have the WebCalendarView on the home page.
Hopefully deploying to GoDaddy and connecting to the database will not be a problem. I’ve done that successfully with SQL Server for a Microsoft control.
My next adventure is to retake C# training to improve my skills so I don't have to ask so many questions.
WebScheduleInfoID="WebScheduleInfo1"
ActivityDialogEvent="True"
ReminderDialogOpening="True">
<igsch:WebMonthView ID="WebMonthView1" runat="server"
style="top: 0px; left: 0px" WebScheduleInfoID="WebScheduleInfo1"
EnableMultiResourceCaption="True" Height="500px"
MultiDayEventFromArrowCaption="" MultiDayEventToArrowCaption=""
StyleSetName=""
StyleSetPath="" StyleSheetDirectory="" Width="500px"
EnableAutoActivityDialog="False"
</igsch:WebMonthView>
Sorry about Thursday. I had an emergency consulting engagement to attend.
So, the WebMonthCalendar is not the control that you want to use. it is not part of the WebSchedule suite of controls. It is strictly a navigational/picker control. To be with the Schedule Suite, it has to have View on the end of the control name. DayView,WeekView,MonthView, and CalendarView. So, you will still need to use one of those controls.
And for the read only portion, there are many ways to do this. Do you want the dialog to just not open. This would be accomplished by handling the clientside events ActivityDialogOpening and ReminderDialogOpening. You can just return true in there and the dialogs wont open.
If you want to have the dialogs open, you can hide or disable the save button so you will never be able to save anything. This will still let you modify things in the dialog, but you will never be able to save.
Then of course, there is traversing the dom of the page and disabling all the controls on there so you will never be able to change anything.
Either of the last two days will require some custom javascript, but should not be too bad.
Please let me know what approach you would like to take.
I'm still trying. I found another control, WebMonthCalendar. I like it and it has a view only option but I don't see any way to connect it to the database or maintain appointments. But there must be a way if it has view only.