Jquery calendar Startdate and enddate validation

Yesterday i got some problem , i had 2 text box Start date and end date and i used Jquery calendar to get the date. well now my problem is
1) user should not select date greater than today
2) end date should not less then start date
3) start date should not greater than end date.

I was breaking my head for that at last i found the solution . Here is the code

var date = new Date();
var dates = $("#txtFrom, #txtTo").datepicker({
dateFormat: "mm/dd/yy",
firstDay: 1,
showWeek: true,
maxDate: new Date(date.getFullYear(), date.getMonth(), date.getDate()),
onSelect: function (selectedDate) {
var option = this.id == "txtFrom" ? "minDate" : "maxDate",
instance = $(this).data("datepicker");
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings);
dates.not(this).datepicker("option", option, date);
}
});


In the txtfrom , txtto is the textbox id.

Hope this will help you guys, If any help needed on this Just comment .

Elam

FREE online mvc conference

Today i am going to attend this free MVC conf. nice topics . You can learn how to write awesome applications on top of the ASP.Net MVC framework in a FREE virtual conference on Feb 8

It’s a community event and a portion of the proceeds will be donated to the jQuery project. All sessions will be recorded and made available free online.

http://www.mvcconf.com/

Elam

Open Source web analytics tool (piwik)

As you guys aware i am working on the web analytics industry, We are thinking to explore the open source web analytics tool “Piwik” . My first impression to the tool is awesome. Thanks to team for such a nice alternative for GA. It;s plug-in based architecture . So i am thinking to write a plug-in for the community and i am working on that..

will give some nice plug-in to piwik other than what i am working..

Regards,
Elam

Configuring ASP.NET website to use SQL Server 2005 for Session state

Today i was working on an application. The session breaks in between and when i was trying to find a problem and i found that ” if anti virus scan’s the website then the session will break it seems”. so thought of storing the session in sql server
and Here is the steps to follow

Step 1

Here is the code to add in web.config


< sessionState mode="SQLServer" sqlConnectionString="data source=#192.168.1.21SQL2005;UID=######;PWD=*******;" cookieless="false" timeout="20"/>

(no need to give DBname)

Step 2

Now we need to run the Install script (InstallPersistSqlState.sql) “Download here” on sql server. Download the Uninstall script here “Download here”

Step 3

After run the script. i got this error “Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.” when i run the website.

Later i found that we need to update the framework for the database . here is the command to run it

Go to command prompt and execute this

C:WINDOWSMicrosoft.NETFrameworkv2.0.50727>aspnet_regsql.exe -S 192.168.1.21SQL2005 -U ###### -P ******* -d ASPstate -ssadd -sstype c

Change the ##### to userid and ******* to password

after this it solved my problem and now my sessionstate is capture in sql server :).

Regards,
Elam

Difference between int.Parse and Convert.ToInt32

Suddenly I thought of knowing what difference is between these both. It sound basic but here we go. Both int.Parse and Convert.ToInt32 are used to convert string into the integer but Only difference between them is to Convert.ToInt32 handle null and returns ‘0’ as output and int.parse is not going to handle NULL and will give a Argument Null Exception. Both are almost same except handling null. We have third option available called int.TryParse which can handle all kind of exception and return result as Output Parameter.
Hope this will help you to understand it better.

About Microsoft webcamps

Hi All

Today i got a opportunity to attend the Microsoft web camps event held in Bangalore. it was a great session. Today Speaker was John Galloway and James Senior, both of them are cool guys. They talked mainly on MVC 3 . It was an nice product, having lot of potential to grow.

Overall the session is good. they are lack of material on MVC3 . it will good if they workout on that..

I am planing  to develop some cool MVC application .. Will post that soon.

Regards,

Elam

Developing and Deploying with SQL Azure

Hi , Microsoft had published a short SQL Azure deployment document , This document provides guidelines on how to deploy an existing on-premise SQL Server database into SQL Azure. It also discusses best practices related to data migration.

Here is the link to Download

Regards,
Elam

Copying Files Over Remote Desktop

Today i came to know how to copy the files over remote desktop . It was really a useful features

Here is the steps to Follow
1) start up a remote desktop dialog.
2) Then expand the dialog by clicking on Options, then check the Local Resources tab
3) Make sure Clipboard is checked, and then hit the More… button.
4) Now you can select a local disk to be shared with the remote machine
5) Once you log to remote desktop . You can see your Local Drive is mapped with it..
6) Just copy paste the file in that..

Still sure this will work on XP . i need to check in some XP machine . But it work on windows 7 and Vista

Regards,
Elam