Working with Calendar in Data list in asp.net - asp.net

I am using datalist to display data from the database,I have got three fields whose Data Type is datetime, What I was looking for is to display a calendar in the datalist , with date selected(coming from database), Also the user can use that calendar to change date , which should update the date field in the database when update is clicked,
Is there any way to integrate calendar in the datalist as perform the above requirements.
Any assistance or suggestions will be appreciated

I'm not specifically promoting Jquery-UI, as there are many js-driven calendars out there, but I've been using it in many different scenarios, and I'm sure it can work in whatever scenario you can imagine: http://jqueryui.com/demos/datepicker/
That control has events, in particular onClose and onSelect. When those happen, you have your date. You can send it to the server either via AJAX or via form-submit (postback).
Also, ASP.NET has a built-in calendar control that supports postbacks, if that's what you are looking for.

Related

Find an event in a calendar

I'm writing an app that reads a Google Sheet that I have read access to. This is working just fine. It contains upcoming dates for things. The sheet contains usually no more than 20 - 30 upcoming events. Events that have passed are ignored.
I need to take these upcoming events and add them to a calendar. Adding events is ok. The problem is that if the app runs again say a week later, the events that are already on the sheet are added again, so I need a way of searching for an event in a calendar based on the date of the event. If I find an event at that date and time, then I can ignore it and move to the next one. It seems that searching for an event requires a calendar ID and an event ID. Is there a way to search for an event by giving a date and time, and say a partial summary?
Failing that, any other options? The data in the Google Sheet I have read access to only. My app doesn't store anything locally. The intention is to read the sheet and add events but not add duplicate events.
To get events you either use events.get where you provide the calendarId and eventId to fetch a specific event or Events.list to get all events.

Displaying data in a datagrid in an Alfresco task form

I have a json array variable defined in my activity workflow definition. Now, I need to present the data of the json array in a datagrid inside a form task. One of those columns should be a check entry filed so that the user may select some rows. After that, I need to get back that data in a subsequent form task (so I need the data to be updated in the json variable so I can read it back, mainly the user selected checks).
Any example to accomplish this? I didnt find almos nothing relating with using datagrids in Alfresco task forms.
thank you!
Miguel

saving data in asp.net form temporarily

I have one requirement of saving data in asp.net form temporarily. I want to re load the saved data in form controls, if on any error or session time out.
Can any body give solution for this?
Thanks in advance.
Save the data in hidden fields as you enter data in hidden fields on key press..Use angular-js for this which makes your work easy,since it supports two way binding.
Upon session expiry retrive the data in hidden fields to the user controls.
The second option is Use Update Panel in the ajax tool kit.
Happy Coding

Update data controls whenever update occuer in SQL table

my question is very simple .
say , I have a grid or combo box , its databounded with a table in sql server database.
I wish when ever there occur some update in data table it refresh the grid .
I did it already with timer but doesn't it consuming resources by sending request after each time out ?
What are the possibilities in experts opinion to get this job done .
You are going to need to write some sort of Ajax type control that compares the TimeStamp of the last update when the grid loads to an Ajax or web service call that will return the TimeStamp of the last update/insert. If they are not the same, then refresh your grid. All web applications are stateless meaning that they do not retain state from call to call. Real time controls in some way shape or other do something similar in its behavior depending upon the arhcitecture the control is built on.

How to refresh a page when record in db table get changed in ASP.Net 3.5

I have a page that contains a Gridview showing a record from a db table e.g. "tblEmployee".
If a record is inserted/updated/deleted in that table then I need my page to be reloaded so that the gridview will show the updated records. Records may be inserted/updated/deleted from any other application.
To rebind the gridview I have to reload the page. Suppose I open the page in my browser and no postback is done. After 10 minutes a record is inserted into the table by some other apps. How can I reload the page automatically, not manually by clicking refresh button when the records in db table changed? I am using Sql server 2005 as DB and ASP.Net 3.5(C#)
Please suggest how to implement this.
Thanks.
Here's two approaches... one using a trigger, the other using SqlDependency. I would recommend using SqlDependency, but I'm outlining another approach because you indicated trouble with SqlDependency.
Create a table with columns for table name and last update date. Create a trigger on tblEmployee to update that table on any insert/update/delete.
When the page is loaded, you'll want to store the current last update date for the table. Depending on how your page is setup, you could store it in ViewState or as a hidden field on the page. Then you'll need to poll for changes. There are many ways to do this. You could write a simple Page Method that returns the last update date, call it from JavaScript, and compare it to the date you stored in the hidden field. Or you could use an UpdatePanel with a Timer control and compare to the value you stored in ViewState.
Now this approach hits the database more than necessary. If that's a problem, use SqlDependency with SQL 2005 or greater. Create a SqlDependency and insert the current date into the Cache with this dependency object. Poll this cache item from the page as described above. When the dependency changes (OnChange event), update the cache item date again.
I see not other option that having a polling mechanism, i.e. using setTimeout+jQuery or ASP.NET AJAX Timer that pulls the information at intervals.
Basically what you want is for the server to notify the client that an update has occurred and in a web/ASP.NET application communication is always initiated by the client. So polling is your only option.
You could use the SqlDependency class:
Here's a getting started example: SqlDependency in an ASP.NET Application (ADO.NET)

Resources