How to disable a collections of dates for Telerik DateTimePicker? - asp.net

For a telerik DateTimePicker, I need you to disable a collection of certain dates, so user cannot select them? Is there any client/server side events that can do this?

Wire the DayRender server and client events of the calendar inside the picker - I found a demo project on the telerik site about that.

Related

What is necessary to init ASPxGridView controls?

i tried to dynamicaly load GridView on the existing page from server. However, when I get the html from the server and insert it into the element, grid appears, but some actions are not available on it (for example drag and drop on columns, filters and so on). Moreover, i have a callback on init event and controls init event, but they dont invoke. Recently, i have loaded gridview with full page and all was good. On support center i found that i need to use ASPx.Evt.DispatchEvent(window, "load"); after insert gridview in my page, but there isnt any explanation about this. Currently, after i have added this piece of code and most of functionality works well and client side events fired, but some are still broken, for example GridView.PerformCallback();. What else i need to do to init controls on my gridview?
Origin code about 'load' event in devexpress support center
https://www.devexpress.com/Support/Center/Question/Details/T489045/how-to-determine-if-scripts-are-loaded
The aforementioned ticket refers to the MVC Extensions product, not the WebForms.
In the meantime, why do you need to render the HTML and add it to the DOM and initialize manually? It is not a good practice for the server-side controls (i.e., when the client-side counterpart should be properly processed).
If you need to add the DevExpress ASP.NET WebForms control dynamically, consider using, for example, ASPxCallbackPanel.

Calender control in asp.net

I am writing a website in asp.net and looking for a control in which I can show a simple but very good looking calender.
The calender shoud show different events with a timestamp on it and additional informations (e.g.: 20 persons registered).
On a click on the event it should show the details.
All this must be read out of a database.
Any ideas?
The Telerik RadScheduler comes to mind, but is paid: http://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx
For free there is FullCalendar for JQuery: http://arshaw.com/fullcalendar/
DHTMLX Scheduler .NET is also an option. Check this demo, it looks good http://scheduler-net.com/demo.aspx

ASP Calendar control like Google's calendar

I'm going to start working on project developed in ASP.NET.
In this project I need to show the data in a month calender like Google's calendar or something like that.
So my question is:
Is there any control I can use to do this thing?
If not, what do you suggest?
There's the Calendar control in ASP.NET which offers some basic functionality that you may take a look at. There's also a calendar extension in the AJAX Control Toolkit.

Is enabling JavaScript in browser a MUST to get working ASP.NET pages?

This is a newbie question (I'm sure it is). I have tried for the first time in a little ASP.NET web application I am working on what happens if I disable Javascript in a browser (I'm testing mainly with Firefox).
Result: My application is completely broken, although I didn't ever write any single line of Javascript.
For instance: I have a link button on a page from a LoginStatus control. Looking at the generated HTML code in my browser I see this:
<a id="ctl00_ctl00_LoginStatus" href="javascript:__doPostBack('ctl00$ctl00$LoginStatus$ctl02','')">Login</a>
Similar with some link buttons in a ListView control which allow to sort the list by certain data fields: The href of the generated anchor tag contains this: javascript:WebForm_DoPostBackWithOptions(...).
So clicking on "Login" or trying to sort does not work without having Javascript enabled.
Does this mean: With disabled Javascript in the browser ASP.NET applications won't work properly? Or what do I have to do to get the application working with disabled Javascript?
Thanks for your feedback!
Some stuff will work, some won't (see here). This is not to say you can't use ASP.NET without Javascript, you'll just have to avoid the below mentioned controls (and I'm sure a plethora of 3rd party controls as well).
The ASP.NET server controls that depend on being able to run client script include:
The LinkButton and HtmlButton server controls require script. (This is not true for the Button Web server control or the HtmlInputButton or HtmlInputImage controls.)
By default, the Calendar control implements month navigation and day selection using LinkButton controls. If you set control properties to allow users to select a day, week, or month, or if you allow users to navigate to other months, then the Calendar control will generate client script. If you use the Calendar control simply to display a single month with no selection or navigation, the control does not require client script.
Any Web server control whose AutoPostBack property is set to true; the client script is required so that the control will post the page.
The Web validation controls, which require client script to support client-side validation. If the client does not support script, validation will run on the server only.
Unless you switch over to the ASP.NET MVC framework, yes, ASP.NET sites built with the web forms model requires JavaScript.
Elements that have autopostback turned on, any linkbutton controls or button controls, and any client-side validation will cease to function, as you've discovered.

Calendar (date-picker) control for mobile devices in ASP.NET

I'm looking for a calendar control (AKA date-picker) that works on mobile devices. The problem is most devices are without JavaScript, or with poor JavaScript support.
ASP.NET's built-in control uses JavaScript to do post-backs. ASP.NET has a mobile calendar control, but it isn't fully localizable (on low-end devices where it displays a step-by-step date picker, its buttons are always in English).
I am thinking of overriding the built-in calendar control to replace the JavaScript post-back directly with parameterized links.
My compound question is -
Is there a good JavaScript-less calendar control, of a way to get rid of JavaScript in ASP.NET's built-in control, or of a way to localize ASP.NET's mobile calendar control?
If all of the above doesn't exist, is replacing the post-back with parameterized links a good way to go? What would other suggestions be?
Currently, I'm not concerned with formatting - the device I'm targeting displays the date-picker well. I'm concerned only with the small problem of getting it to work...
What I ended up doing is building a custom calendar control.
For now, I used a table, but it will have to change when I want to support more devices. Since I'm targeting right-to-left languages, a table is already a pain.
#troelskn - I didn't go for <select> because they're not comfortable for a user using a mobile device, but thank you for the advice.
You can generate some dropdown (<select>) boxes and use them as a simple datepicker. You'll need to do some server side validation though, since no JavaScript would mean that the user could pick an invalid date (for example, 31st of Feb).

Resources