Wednesday, 18 September 2013

Select/Deselect multiple check boxes using jQuery

HTML Code : 

<div><input id="chkAll" type="checkbox"/>Check all Boxes</div><br />
<table id="tblBoxes">
      <tr><td><input id="Checkbox1" type="checkbox" class="chkA"/></td><td>Check box - 1</td></tr>
      <tr><td><input id="Checkbox2" type="checkbox" class="chkA"/></td><td>Check box - 2</td></tr>
      <tr><td><input id="Checkbox3" type="checkbox" class="chkA"/></td><td>Check box - 3</td></tr>
      <tr><td><input id="Checkbox4" type="checkbox" class="chkA"/></td><td>Check box - 4</td></tr>
      <tr><td><input id="Checkbox5" type="checkbox" class="chkA"/></td><td>Check box - 5</td></tr>
</table>

Script Code : 

 $(document).ready(function () { 
     $("#chkAll").click(function(event) {
         if($('#chkAll').prop('checked'))
             $('.chkA').prop('checked', true);
         else
             $('.chkA').prop('checked', false);       
     });
     

 });


Check for online Demo 

note : add required jQuery files.

Thursday, 22 August 2013

Calling .aspx page in JQuery popup message

       1)      Download the below JQuery files from JQuery.com and paste the  below JQuery files to JQScripts folder
        jquery-ui-1.9.1.custom.min.js
        jquery-latest.js

        2)      Do the same for following file also
         jquery-ui-1.9.1.custom.css

         3)      Copy and paste the “images” folder to Css

          4)      Load the script and CSS files, in which page you want to display JQuery Model pop up
<script src="JQScripts/jquery-latest.js" type="text/javascript"></script>
<script type ="text/javascript" src="JQScripts/jquery-ui-1.9.1.custom.min.js"></script>

<link href="Css/jquery-ui-1.9.1.custom.css" rel="stylesheet" type="text/css" />

         5)      Add the following script in script tag of <head> section

$('#openDialog').dialog({
                                                                                title: "Rate plan - More info",
                                                                                //show: "blind",
                                                                                hide: "explode",
                                                                                modal: true,
                                                                                width: 800,
                                                                                height: 250,
                                                                                top: 15
                                                                    });

                                                                    $('#openDialog').load(url, function () {                  
                                                                                $(this).dialog('open');
                                                                    });                       

       6 )      Add the html code in between <form> </form> tag or <body>  </body> tag
<div id="openDialog" style="top:15px !important;"></div>

Thursday, 6 June 2013

Compare two dates in .NET based on Day



Compare two DateTimes:

DateTime date1=Convert.ToDateTime("06-01-2013");
DateTime date1=Convert.ToDateTime("06-01-2013");

int days = DateTime.Compare(date1, date2);

* days > 0      date1  is greaterthan date2
* days = 0      date1 and d2 are equal
* days < 0      date1 is lesserthan date2

But the problem with DateTime is it will compare with exact values with time also.


Compare only two Dates :

TimeSpan ts= date1 - date2;

TimeSpan will return exact days & hours and we need to extract the days from it and we can compare.

* ts.Days > 0      date1  is greaterthan date2
* ts.Days= 0       date1 and d2 are equal
* ts.Days <  0     date1 is lesserthan date2  

Here ts.Days will give you exact days..

Friday, 4 January 2013

sending SMS from .Net using Way2SMS Gateway



Description: you can send free sms by using way2sms gateway from your .Net Application. Here, Just you need to give your login credentials of way2sms.com from your app.

Implementation:
Step 1: Design you UI based on your requirement. Here for your reference I took two input  textbox’s and which one is for accepting mobile number and another one is for message.


Step 2: Go to code window and define 4 local variables of string type, which are username,Password,Message and Mobile number.
Step 3: Now Download way2sms dll file from source click here. And save it into your local drive.

Step4: open your project and select Add Reference in Solution Explorer and select browse option and select smsClient.dll file

Step5 : Go to your code and write following code in button click event.
        
        SendSms newSms = new SendSms();
       string status = string.Empty;
                status = newSms.send(userName, passWord, txtMsg.Text, txtMobileNo.Text);
        if (status == "1")
        {
            lblResult.Text = "Message sent successfully";
        }
        else
            lblResult.Text = status;

Step 6: send() of SendSms class is required 4parameters as follows,

public string send(string uid, string password, string message, string no);

Step 7 : Now you can enjoy to send SMS. and you can find full source code here

Monday, 10 December 2012

Windows Mobile


Windows Phone is a family of mobile operating systems developed by Microsoft. It was first launched in October 2010, with a release in Asia following in early 2011.With Windows Phone, Microsoft created a new user interface, featuring its design language called Modern Style UI. Additionally, the software is integrated with third party services and Microsoft services, and sets minimum requirements for the hardware on which it runs.
The windows phone is having ultimate features and user interface. We can get live updates in home screen itself. Suppose I configured my Gmail and face book in windows phone and we can set these two in home screen tiles. When we get new mails and face book update, the count will be displayed in those tiles and we have Anti Theft feature here. Using that feature we can lock and erase our personal data like contacts, messages, email accounts, personal information and settings from mobile.

Lets we can discuss about our feature. Follow the following steps to do this.
1. Create windows live id or hotmail account
2. Go to your windows phone -> settings -> find my phone -> select the check box.
3. Go to windowsphone.com and login with your live id.
4. Here in top corner you will find my phone option select that and check your windows phone name here.
Now, there are 3 things we can do from windowsphone.com
Select
 Find my phone option from top corner side and you will get following 3 options along with your windows phone name.
1. Ring

When you select ring option, your phone will ring even its in low volume also.
2. Lock

When select Lock option, your phone will lock until you give the password for that, which you will give in windowsphone.com
and you have to give your mail id, so that updates will go for that mail about this.
And one more feature I observed here is we can pass some message for our windows phone home screen. So, that message will be showing in windows phone home screen. Suppose when we forgot our windows phone in somewhere in travel, office, restaurants we can login in windowsphone.com and if we lock phone by passing some message to mobile home screen like
 " I forgot my phone. Please call 1234567890 and return back ". It will be useful.

3. Erase

The Erase option will erase all our personal data in windows phone. When our mobile is theft from use at least we can prevent our personal data in it.

now a days windowsphones are giving major competition for all smartphones.
Hope it will helpful...
 

Wednesday, 5 December 2012

Develop mobile applications using Sencha Touch


              Sencha Touch enables you to quickly and easily create HTML5 based mobile apps that work on Android, iOS and Blackberry devices and produce a native-app-like experience inside a browser.
Requirements :
  • Sencha Architect. You can download it from following link to get 30days trial version. Click here
  • A web server running locally on your computer.
  • A modern web browser; Chrome and Safari are recommended.

Sencha Architect Architecture :


Code for Sample Application :
Open up the Project directory. The directory structure looks like this:


Here's a description of each file and directory:
·         app - directory containing the Models, Views, Controllers and Stores for your app.
·         app.js - the main Javascript entry point for your app.
·         app.json - your app configuration file - used by the Builder to create a minified version of your app.
·         index.html - The HTML file for your app.
·         packager.json - The configuration file used by the Packager to create native versions of your app for iOS and Android app stores.
·         resources - directory containing the CSS and Images for your app
Open app.js, the main entry point for your app, in your editor

  
Example:
Step 1: Open Sencha Architect  & select create NewProject. Give project name and save it in desired location.

Step 2: Select Target orientation iPhone(320*480) or iPad(768*1024).
Step 3: Drag container from Toolbox & Drop it in Design mode. Here Now View is getting Created.
Step 4: Give the required properties for that view from the property configurations like userClassName, scrollable(true),border, docked, height, width etc.
Step 5: drag & drop button, label from toolbox to your view and name it.
Step6 : Select button and add handler through property configuration window & add the following code for that handler.
Ext.getCmp('lblDisplay').setHtml('Hello!!! This is first Sencha Touch Application');
Step 7: Go to the target folder & Run app.html file in browser(Chrome &Safari recommended).

Output :


References:
                        Sencha official website
                        Sencha Touch Documentation

Conclusion:    The Sencha Touch Architect provides good environment for developing mobile application for Android as well as iPhone & iPad also.
            

Sencha Touch Introduction


Sencha Touch
Sencha Touch, a high-performance HTML5 mobile application framework, is the cornerstone of the Sencha HTML5 platform. Built for enabling world-class user experiences, Sencha Touch is the only framework that enables developers to build fast and impressive apps that work on iOS, Android, BlackBerry etc.
Sencha Touch 2.1 is the latest version of the market leading mobile app framework. This release focuses on improving performance and adding features to make developers more productive. The updated list component now supports infinite scrolling, enabling apps to show an unlimited amount of data.
An all-new, ultra high performance version of Charts is included as a part of Touch (available as GPLv3 or as a part of Sencha Complete and Complete: Team). Charts now adds retina display support, new financial charts, and improvements to the Draw and Chart packages for expanded flexibility. Finally, Sencha Touch 2.1 provides enhanced native support through the Sencha Mobile Packager, which is now part of the new Sencha Cmd. 
Sencha Cmd
Sencha Cmd is the cornerstone to build your Sencha application. From scaffolding a new project, to minifying and deploying your application to production, Sencha Cmd provides a full set of lifecycle management features to compliment your Sencha project.

Features:
Built on HTML5 Technology
Sencha Touch 2, a high-performance HTML5 mobile application framework, is the cornerstone of the Sencha HTML5 platform. Built for enabling world-class user experiences, Sencha Touch 2 is the only framework that enables developers to build fast and impressive apps that work on iOS, Android, BlackBerry, Kindle Fire, and more.

Smoother Scrolling and Animations

Sencha Touch 2 provides a user experience unparalleled in HTML5. Fluid animations and smooth scrolling make Sencha Touch 2 apps come alive, rivaling native technology. Lists, carousels, and other components scroll smoothly and naturally, with a high frame rate across a wide range of devices. The framework automatically uses the best scrolling mechanism for each device, resulting in a great experience everywhere.

Adaptive Layouts

Sencha Touch’s novel layout engine leverages HTML5 in powerful ways to let developers build complex applications that respond, load, and layout in a snap. Switching from landscape to portrait happens nearly instantaneously, and applications load in fractions of a second as Sencha Touch 2’s advanced layout engine ensures pixel perfection.
Native Packaging
Web applications work everywhere. But there are still a few features uniquely available to native apps — like camera access and app store distribution — that are essential to app developers. Sencha SDK Tools give you the best of both worlds, providing a way to seamlessly “wrap” your web app in a native shell. Whether you’re on Mac or Windows, you’re one command away from deploying to the Apple App Store or Android Market.