-
Play Item
How to Create a Web Application Using Web Control Class
By 5minLearn how to design a page with Web Controls in…
-
Play Item
How to Add ASP.NET Standard Control Class in Web Application
By 5minLearn how to add standard ASP.NET Standard Control Class in…
-
Play Item
Learn about Different Types of Control with ASP.NET Data Control Tab
By 5minOverview with different types of controls with ASP.NET Data Control…
-
Play Item
Learn about Different Types of Control with ASP.NET Validation Control Tab
By 5minOverview with different types of controls with ASP.NET Validation Control…
-
Play Item
How to Treat Coughing in Dogs
in DogsThis video will focus on how to diagnose and the next course…
-
Play Item
How to Enlist the Help of a Travel Professional
in GeneralLearn how to enlist the help of a travel professional in this…
-
Play Item
Che Guevara - Profile
in GeneralIn this profile video learn about Che Guevara and his life in…
-
Play Item
Shaun Alexander Teaches How to Protect the Football - Running Tips From an NFL MVP
in FootballProtecting the football is not an easy task. NFL Pro,Shaun Alexander explains…
How to Add ASP.NET Calendar Control in Web Application
More DIY videos at 5min.com
Video Summary:
Learn how to add Calendar Control with ASP.NET Web Control Class.
Video Tags:
web control class, visual studio 2005, aspnet, Microsoft Windows, web development, total training
Source: How to Add ASP.NET Calendar Control in Web Application
Video Transcript: (More)
Well, you might have notice, in the standard tab in the toolbox as well as having this set of pretty much list of labels for the HTML Controls. But as well we have some quite high level, very rich controls such as calendar. So, I thought it would be quite cool to add a calendar to our webpage to represent the course of date of birth. So, in order to do that, we’ll go back to the table and we’ll add another row. We’ll choose the second row and right click and insert a table row below. Okay and in the left hand column of the new row, let’s add a label and the label will set some properties. We’ll set the ID to be BirthdayLabel and we’ll also set the text to be birthday. And now then the calendar is going to be quite big. So, I am going to—well let’s just see if it fit into that server. Let us drag a calendar and drop it into this table and see what it looks like.
Well, we have a small tag straight away which enables us to auto format this rich control. So, let us just click on that and this is quite simple really. Let’s choose which formatting we want. Well, that is quite nice. Let’s go for that one. It is colorful too. I am going to click OK and let’s get rid of the small tag because we are done with that. Now, if we come down to the properties window and I am just going to make this a little bit bigger, there is an absolute abundance of properties we can set on this control. Obviously, the first property we want to set is the ID. So, let’s go back up to the top and set the ID to be BirthdayCalendar. And also let us see what other properties you can set. There’s a property called DayNameFormat where you can format or influence the format for the date as it’s displayed in the calendar. So, we can choose shortest or we can choose first two letters or we could choose full. That is a little bit on the big side. So, let us just go for short and we can also specify, let’s see what else we got here.
First day of week, so for example, you might say that the first day of the week is Sunday or alternatively you might say that the first day of the week is Monday, okay. So obviously, this is quite straightforward but it’s quite important to get just the right professional looking for your free website. Next, pre-format. So, we could specify ShortMonth and you can see what’s done up here. It has actually specified the name s of the months before and after of the current year or we can go for FullMonth or we could go for just custom. I think I prefer that. Okay, so the various other properties feel free to have an experiment yourself.
Let us just run the application and see that it works properly. So, Control-F5 runs without debugging, there it is. So, the birthday, I can go forward to next month. And wow look at this, great! Have a look down at this area as I click the arrow. Every time I click the arrow, there is a postbox to the server and it requires service side processing to actually provide this or to regenerate the image for the calendar. It is pretty not surprising. So, we will enter a name, Thomas. That is the name of our little boy and Thomas is also an adopted Walesman and Thomas is also eight because they are twins and he cannot program in anything yet. So, we will just go for J# and his birthday is July 2nd, so making out of it. Try the second and submit. There we are.
So, we are done with this example. We’ve seen quite a lot of stuff here. We’ve seen how to use high level controls such as Textboxes and Labels and DropDownLists and CheckbookLists plus the rich controls such as calendar and it is interesting just to before we finish to look at the source code that’s being rendered for this calendar control. So, I will click View Source and well there’s a lot of stuff here that we can just ignor





No comments yet.