Monday, May 13, 2013

ASP.NET 4.5 Features - Key HTML Editor Features

With release of ASP.NET 4.5, we have seen many new enhancement in HTML.Today, we would be go through HTML key editor features introduced in ASP.NET 4.5.
Below are the most important / productive enhancement introduced in HTML with ASP.NET 4.5

a) Smart Tasks
b) Extract to User Control
c) HTML5 Snippets
d) Automatic Renaming of matching tag
e) Event Handler Generation

Automatic Renaming of the matching tag

In ASP.NET 4.5, we have very productive feature where matching tag is automatically renamed when we change the opening tag.
Consider the below code in HTML side















Now in earlier version of ASP.NET if i have to make a change in the starting tag then i had to manually update the end tag too. However, with ASP.NET 4.5, you would see that if you update starting tag, then end tag would also update automatically.
Please see below image for more details.















Extract to User Control
ASP.NET 4.5 has come up with very unique and productive feature where at any point of time, we can change code present in web form to user control.
Consider i have a web form containing textbox for userName and Password for authentication. While working on this page, we found that we need this user name and password authentication in different modules of the project.









With this said, ASP.NET 4.5 provides us the greate feature where we have to simply select the code and we can change that selected code to User Control

























Smart Task in HTML Editor
One of the productive feature added in ASP.NET few years back was addition of smart task. On the click of the smart available on the control, you can accomplish some of the common task on that control.

















Now with ASP.NET 4.5, we have same feature while working on HTML side. Hence, we don't have to go to design mode to use this feature.










If you click on the line present under 'a' , this would open up the smart task for that control.













You can see that you can perform all the common task for that control

Code Snippets in HTML
With ASP.NET 4.5, we have code snippets available in HTML.
If you want to add Audio or video on you page, you simply have to type video on HTML and press TAB twice. You will see that full audio / video control is available with you, mentioning all the common properties














Event Handler generation

Before the release of ASP.NET 4.5, if we have to create any event handler for any control, we either have to double click on that control, which will generate an event for that control or define the even in the properties of that control. However, with ASP.NET 4.56 we have new property added in the control, where we can generate an event for control at HTML side and we don't have to switch to design mode.








Clicking on 'Create New Event' would create default event for that control;however we can give any name of that event and you would see that Visual Studio will then automatically generate the appropriate server side event handler within your code behind file for you.











Hope this article of mine has been helpful in giving some knowledge new features of ASP.NET 4.5. To read more such articles visit my blog - http://varunkhanna.blogspot.com/





Saturday, May 11, 2013

Setting Reminder in Windows Phone Application

We have already seen how to set Alarm in Windows Phone. Please follow this link to read my article. Today, we would see how to set reminders in Windows Phone application. Its pretty much same as we did setting up Alarm in Windows Phone.

1) To start with, we would create windows application.

2) Then we need to add the following namespace in the code behind
using Microsoft.Phone.Scheduler

3) Below are the reminder properties that are available in Reminder class

  • Content - Message to be displayed when reminder triggers
  • Title - Title of the Reminder screen
  • BeginTime - Time when reminder would be triggered
  • ExpirationTime - End time of the reminder
  • NavigateURI - URL of the page when anyone clicks on the reminder screen
4) Below is the code for the same

            var Myremider = new Reminder("MyReminder");
            Myremider.Title = "My Reminder";
            Myremider.Content = "Reminder Application";
            Myremider.BeginTime = DateTime.Now.AddMinutes(1);
            Myremider.ExpirationTime = DateTime.Now.AddMinutes(10);
            Myremider.NavigationUri =new Uri( "www.google.com",UriKind.Relative);

            ScheduledActionService.Add(Myremider);


Hope this article of mine would give you some basic knowledge of setting reminder in windows phone.

Monday, May 6, 2013

Setting Alarm in Windows Phone

Today, we would see how we can set notifications in Windows phone application. There are two type of notifications that can be set in Windows phone

  • Alarm
  • Reminder
We would see how we can set ALARM in windows phone application.

1) Create a Windows phone application
2) Add following namespace
using Microsoft.Phone.Scheduler;

3) Following are the properties of Alarm class

a) Content - Specify the text you want to show when Alarm is triggered
b) Sound - You can specify any sound file to be played when Alarm is triggered
c) BeginTime - Specify the time when you want Alarm to be triggered
d) Expiration Time - Specify the time / days / month / year you want Alarm to be triggered

4) Below is the code for setting the Alarm in Windows Phone

            var NewAlarm = new Alarm("MyNewAlarm");

            NewAlarm.Content = "Testing Alarm";
            NewAlarm.Sound = new Uri("MaulaMere.mp3", UriKind.Relative);
            NewAlarm.BeginTime = DateTime.Now.AddMinutes(1);
            NewAlarm.ExpirationTime = DateTime.Now.AddDays(30);

            ScheduledActionService.Add(NewAlarm);

Hope this article of mine provide the basic knowledge of Alarm in Windows Phone