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.
Hey Steve,
I found the problem but haven’t solved it yet.
I build a new test application and got it working but it went to the wrong database as before.
So I went back to your instructions starting with, “Sorry, I fell for the same thing” where you were explaining the DataSourceID. I didn’t know how to do the 1st option so I did the 2nd one.
I added this to Page_Load
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|\WebSchedule2.mdb";
this.WebScheduleOleDbProvider1.Connection = conn;
And I have this in the web.config. The 1st commented one gives me an error.
<!--<infragistics.web styleSetName="Default" styleSetPath="~/ig_res"/>-->
<infragistics.web styleSetName="Default" styleSetPath="~/ig_res" formsDirectory="~/WebSchedule"/>
I get this error when adding the Page_Load Ole… although I thought I once had it working.
Parser Error Message: The base class includes the field 'wdcStartTime', but its type (Infragistics.WebUI.WebSchedule.WebDateChooser) is not compatible with the type of control (Infragistics.WebUI.WebSchedule.WebDateChooser).
Source Error:
Line 53: <TD style="WIDTH: 110px" noWrap><span style="WIDTH: 110px"><igsch:webdatechooser id="wdcStartTime" style="DISPLAY: inline" tabIndex="3" width="100%" runat="server" EnableKeyboardNavigation="true">
Source File: /WebSchedule/AppointmentAdd.ascx Line: 53
Corrected error when commented out the OleDb.... in Page_Load
Switched these and got error below
<infragistics.web styleSetName="Default" styleSetPath="~/ig_res"/>
<!--<infragistics.web styleSetName="Default" styleSetPath="~/ig_res" formsDirectory="~/WebSchedule"/>-->
The resource cannot be found.
So I think I have everything ok except for the MasterPage problem.
I’ll keep working on it although I’m going away for a week starting Dec. 1
Jim
I know I'm almost there but I'm feeling really discouraged. I thought I had it working.It works with the code below but goes to the wrong database.
This is from CalendarMaint.aspx
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand="SELECT * FROM [Activity]"></asp:AccessDataSource>
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" EnableRecurringActivities="True"></igsch:WebScheduleInfo> <ig_scheduledata:WebScheduleOleDbProvider ID="WebScheduleOleDbProvider1" runat="server" WebScheduleInfoID="WebScheduleInfo1" DataSourceID="AccessDataSource1"></ig_scheduledata:WebScheduleOleDbProvider>
<table> <tr> <td> <igsch:WebCalendarView ID="WebCalendarView1" runat="server" WebScheduleInfoID="WebScheduleInfo1"> </igsch:WebCalendarView> <br /> </td> <td> <igsch:WebWeekView ID="WebWeekView1" runat='server' EnableMultiResourceCaption="True" StyleSetName="" StyleSetPath="" StyleSheetDirectory="" WebScheduleInfoID="WebScheduleInfo1" Width="400px"> </igsch:WebWeekView> </td> <td> <igsch:WebDayView ID="WebDayView1" runat="server" EnableMultiResourceCaption="True" MultiDayEventFromArrowCaption="" MultiDayEventToArrowCaption="" StyleSetName="" StyleSetPath="" StyleSheetDirectory="" WebScheduleInfoID="WebScheduleInfo1" Width="300px"> </igsch:WebDayView> </td> </tr></table>
This is from CalendarMaint.aspx.cs
namespace WebCalendar4{ public partial class CalendarMaint : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //OleDbConnection conn = new OleDbConnection(); //conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|\WebSchedule2.mdb"; //this.WebScheduleOleDbProvider1.Connection = conn; } }}
When I uncomment the 3 lines from Page_Load I get the following error.
Parser Error Message: The base class includes the field 'wdcStartTime', but its type (Infragistics.WebUI.WebSchedule.WebDateChooser) is not compatible with the type of control (Infragistics.WebUI.WebSchedule.WebDateChooser).Source File: /WebSchedule/AppointmentAdd.ascx Line: 53
<TD style="WIDTH: 110px" noWrap><span style="WIDTH: 110px"><igsch:webdatechooser id="wdcStartTime" style="DISPLAY: inline" tabIndex="3" width="100%" runat="server" EnableKeyboardNavigation="true">
I'm sorry if I'm being a pest. I will be away Dec. 1 - 6. Maybe if I can't resolve it I can bring it to the user group meeting on Dec. 9.
If you are using the second way by setting up the connection in the code behind, you do not need the AccessDataSource. You can comment that out. Then just get rid of the DataSourceID property on the WebScheduleOleDBProvider that points to AccessDataSource1. That should be it. It might be trying to get both locations and causing some weird behavior. However, what is strange is that if I have all of that in there, mine still works and will not error out.
Another thing to try. Take out the formsDirectory property in the web config settings.
Then on the WebScheduleInfo itself, you can direct the forms location by setting the AppointmentFormPath and ReminderFormPath to ~/WebSchedule/AppointmentAdd.aspx and ~/WebSchedule/Reminder.aspx respectively.
AppointmentFormPath="~/WebSchedule/AppointmentAdd.aspx"
This will cut out the web.config setting. Now keep in mind, you will have to set this on every ScheduleInfo that you are using. Other then this, im not sure what else the problem is. If it comes down to it, I can probably stick around after work and attend the user group to see what the issue is. I am all out of ideas.
Hi Steve,
I tried all these ideas and I'm still getting the same errors. I'm sure it must be something obvious that I'm doing wrong but I can't find it.
If you would be kind enough to meet me at the user group meeting on Tuesday, 12/9 maybe we can resolve this and I can stop bothering you.
I can come early if you like so you don't have to stay after work. But whatever time is best for you would be good for me.
Again, thanks for all your help. I'm sorry this has been so difficult.
Hey Jim,
I will be sticking around next Thursday for the UserGroup meeting so I will be able to take a look at the project then. Can you get here at like 530 so I will have time to take a look at the project befrore the user group starts? That would be great. If not, I will still take a look at it. Then hopefully we will be able to get this problem taken care of once and for all.
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.
<td>
<igsch:WebCalendarView ID="WebCalendarView1" runat="server"
WebScheduleInfoID="WebScheduleInfo1"
ActivityDialogEvent="True"
ReminderDialogOpening="True">
</igsch:WebCalendarView>
</td>
<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.