September 16, 2013
ASP.NET MVC we use client side validation using jQuery.validate plugin, which will be based on Model – Data Annotation validation attributes.
In some cases we might want to disable such validation on a button click wherever it is not needed.
The below code block will register validation block for Title property in the Model, will result in client side validations fired when user click on button.
@Html.EditorFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title)
<input type="submit" name="backButton" value="Back" title="Go back to Prev step." />
We can disable the client side validation check for a button using the “disableValidation=true” attribute for the button.
document.getElementById("backButton").disableValidation = true;
<input type="submit" name="backButton" value="Back"
title="Go back to Prev Step" disableValidation="true" />
You disable client-side validation on a button by adding the css style class “cancel” to it.
That will look like below example:
<input type="submit" name="backButton" value="Back"
title="Go back to Prev Step" class="mybtn-style cancel" />
These are the different ways you can disable the client side validations. Hope it was helpful.
September 12, 2013
.NET, .NET Framework, .NET Framework 4.5, ASP.NET, ASP.NET 4.5, ASP.NET MVC, C#.NET, HotFixes, Microsoft, Updates, VisualStudio, VS2012, Windows, Windows 8, Windows 8.1, Windows Phone
Microsoft has released the Visual Studio 2012.4 RC3 Update for Visual studio 2012. This update includes lots of bug fixes and improvements.
Here are some informative links for you:
August 12, 2013
C#.NET, Codes, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile-Development, VisualStudio, VS2012, Windows, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, XAML
This post will give you an overview on how to identify the sensors supported on your Windows Phone. As a developer when you are developing for Windows Phone – and your application would need to interact with certain sensors in windows phone to achieve a certain functionality, you would need to verify whether the sensors are supported in targeted devices.
Windows Phone 8 platform has support for the following sensors
- Motion sensor
You can access these API’s through the below namespace:
You can check for any of the sensor support through “IsSupported” boolean property of the class
- Motion sensor [ Microsoft.Devices.Sensors.Motion ]
- Accelerometer [ Microsoft.Devices.Sensors.Accelerometer ]
- Compass [ Microsoft.Devices.Sensors.Compass ]
- Gyroscope [ Microsoft.Devices.Sensors.Gyroscope ]
Here is the sample code block:
public static string GetSensors()
StringBuilder sensorsList = new StringBuilder();
Note: Only Accelerometer is supported in Windows Phone 8 emulator. To test remaining capabilities, you would need to deploy the application on a real Windows Phone device.
August 9, 2013
.NET, ANDROID, Blackberry, Extensions, iOS, iPhone, KnowledgeBase, Microsoft, Microsoft SDKs, Mobile, Mobile Services, Mobile-Development, Nokia, Third-Party-Libraries and Frameworks, VisualStudio, VS2010, VS2012, Windows, Windows 8 apps development, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store, Windows SDK, Windows Store, Windows Store Development
This is an update blog to my earlier blog about Sending Apple iOS Push notifications using C#.
With that blog – I introduced you to how to send push notification using Open Source library APNSharp, by the developer John Redth. Redth announced that library is already deprecated.
Redth came up with with another open source project called as PushSharp:,published under apache software foundation license.
PushSharp is a server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM – Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!. Single library serves the purpose of sending push notifications to multiple platforms. Pretty decent isn’t it?
Here is the basic architecture:
Features of PUsHSHARP
- Supports sending push notifications for many platforms:
- Apple (APNS – iPhone, iPad, Mountain Lion)
- Android (GCM/C2DM – Phones/Tablets)
- Chrome (GCM)
- Amazon (ADM – Amazon Device Messaging)
- Windows Phone 7 / 7.5 / 8 (including FlipTile, CycleTile, and IconicTile Templates!)
- Windows 8
- Blackberry (BIS and BES via PAP)
- Firefox OS (Coming soon)
- Fluent API for constructing Notifications for each platform
- Auto Scaling of notification channels (more workers/connections are added as demand increases, and scaled down as it decreases)
Implementation using PushSharp is straight forward
Here’s some sample code: shared by Redth
//Create our push services broker
var push = new PushBroker();
//Registering the Apple Service and sending an iOS Notification
var appleCert = File.ReadAllBytes("ApnsSandboxCert.p12"));
push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "pwd"));
.ForDeviceToken("DEVICE TOKEN HERE")
//Registering the GCM Service and sending an Android Notification
//Fluent construction of an Android GCM Notification
//IMPORTANT: For Android you MUST use your own RegistrationId here that gets generated within your Android app itself!
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId("DEVICE REGISTRATION ID HERE")
You can get the Push Sharp for your .NET projects from below mentioned links:
Binaries from NuGet: https://www.nuget.org/packages/PushSharp
To install PushSharp, run the following command in the Package Manager Console
PM> Install-Package PushSharp
Source Code from GitHub: https://github.com/Redth/PushSharp
Documentation and Implementation Guides available at wiki page: https://github.com/Redth/PushSharp/wiki
Quick links to implementation guides
You can read my previous blogs here:
Sending Apple iOS Push notifications using C#
Apple Push Notifications Service API & C#
August 2, 2013
.NET, HotFixes, KnowledgeBase, Microsoft, Microsoft SDKs, Updates, VisualStudio, VS2012, Windows, Windows Phone, Windows Phone 8, Windows Phone 8.0 SDK, Windows Phone Development, Windows Phone SDK, Windows Phone Store
Microsoft has released a new Windows Phone SDK 8.0 Update. This update for Windows Phone 8.0.10322 adds four new emulator images to an existing installation of Windows Phone SDK 8.0. This update requires Visual Studio 2012 Update 2. Using this update, you can test how your apps will run on devices that have build 8.0.10322 or higher of Windows Phone 8.
This update adds the following to an existing installation of Windows Phone SDK 8.0:
- New Windows Phone Emulator 8.0 (10322) WVGA
- New Windows Phone Emulator 8.0 (10322) WVGA 512 MB
- New Windows Phone Emulator 8.0 (10322) WXGA
- New Windows Phone Emulator 8.0 (10322) 720p
Note: Windows Phone SDK 8.0 and Visual Studio 2012 Update 2 requires to be installed before this update.
Download: Windows Phone SDK 8.0 Update for Windows Phone 8.0.10322 (an MSI installer of 920MB)