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
Hi Steve,
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?
Jim
Hey Jim,
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.