Friday, December 19, 2008

How to add MS Chart controls into Toolbox

Article Chart-2, even more detail step by step explanation.

MS-Chart Tutor-1.. with source code (latest)






Other articles...
1. Reporting Services : Parameters in stored procedures. Step by step explanation.
2.Installing MS chart adding into vs 2008 toolbox and using MS chart with sample code
3.Great - Excellent Jquery plugin links and examples
4.SMS: Send Recieve SMS through GSM modem in .Net
5.Login failed for user 'Server\ASPNET'.
6.Sending Email using Templates Asp.net
7. Null problem with many dropdowns in Reporting Services


MSChart is out now.  The very important thing which most of the ASP.Net developers of VS 2008 were waiting to use. Yes it is glassy and professional charts.

I was looking some Jquery charts but after seeing this , i cant control myself using these charts.




It looks almost or exactly like dundas charts, but whatever the charts are beautiful.







 
Advantages:
1.
 Easy to use.
2. no third party components.
3.Attractive and pleasing.
4.
 Quality of charts are superb.
5. Offcourse it is free. :-) 

Requirements:



1. .NET 3.5 SP 1, download it from here.. .Net Framework 3.5 sp1 download.
1. VS 2008 with vs sp1, you can download it from  VS
2. MSChart.  Download it from here : Download MSChart.
3. MSChart documentation here : Download MSChart documentation.
   

Other Related links:







  Some sample links : Here




Steps:



1. Install .Net 3.5  Sp1.
2. Install VS 2008 Sp1.
3. Install MsChart.exe.

Easy way to add Chart controls in toolbox is ....
1. Download this MSChart add-on, from here. 
     and install it. 
Simple is it....

 Or follow the following steps below and take the help of screen shots .

a. Open a Project in VS 2008 >> Toolbox >> Add new Tab>> Choose Items.
Follow this screen shots...

b. You must find your dll in this path,
    C:\Program Files\Microsoft Chart Controls\Assemblies
c. Follow the screen shots.
d.  dll you need to add is 
     For windows : System.Windows.Forms.DataVisualization.dll
     for web  : System.Web.DataVisualization.dll.


Simple you are done with new attractive chart controls.

In next part, i will show you how to configure and display different type charts.


I will be glad to answer if anybody has any difficulty to follow.







Thursday, December 18, 2008

Jquery - Part 1 : Setting and Getting control properties

For the new beginners in Jquery, including myself i faced problem to start and to set the attributes of  controls.

Kenneth Scott made my life easier, please follow his blog for more info.


Happy Jquering.

Monday, December 15, 2008

Javascript dd/mm/yyyy validation.

Easy to find simple and effective Javascript dd/mm/yyyy validation.
Use the below code in script tags.

function ValidateForm(){
var dt= document.getElementById('txtDate').value
if (isDate(dt.value)==false){
dt.focus()
return false
}
return true
}

var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
var i;
for (i = 0; i < s.length; i++){
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}

function stripCharsInBag(s, bag){
var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++){
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}

function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
if (i==2) {this[i] = 29}
}
return this
}

function isDate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strDay=dtStr.substring(0,pos1)
var strMonth=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
alert("The date format should be : dd/mm/yyyy")
return false
}
if (strMonth.length<1 || month<1 || month>12){
alert("Please enter a valid month")
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
alert("Please enter a valid day")
return false
}
if (strYear.length != 4 || year==0 || yearmaxYear){
alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
alert("Please enter a valid date")
return false
}
return true
}

Friday, December 12, 2008

Top Search Engine Page Ranking Secrets in Google


1. Unique page titles
     Create proper unique and accurate page title.

2.
       do not forget to add this metatag in all your pages and try to keep most matchable keys with the corresponding title of the page.

3. url should have keys of search
      if your page will be in a folder, your search key and folder names should match,
      this will increases the chances of hits.   

4. Sitemap
        Sitemap is a must and it should cover all the links involved in the website.

5. Consider what happens when a user removes part of your URL
     if a user enter partial URL eg: www.abc.com/Jan/2008 instead of  www.abc.com/Jan/2008/home.htm the website should navigate to any default page, so you will never miss an guest user and it improves page ranking


6. Have a useful 404 page
     have a custom page to redirect to a default page instead of showing 404 page.

7. Include google custom search.


8. Heading tag
     use appropriate heading tags after the body  
Eg:  10 Top Secrets of google, 10 Top Secrets of Life,10 Top Secrets of Fun.. :-)


9. Alt in the Image
    do not forget to put  "alt" description for each images . Eg :alt="www.abc.com : home logo Google"

10. Use web webmaster tools.