Comparision of two textboxes using Dates … Calendar Extendar in Asp.net with javascript

May 14, 2013

Comparision of two textboxes using Dates with calender extender and javascript

try this, it’s works for me.
function CheckValid(){

var fromDate = $(‘#<%=txtFromDt.ClientID %>’).val();
var toDate = $(‘#<%= txtTodt.ClientID %>’).val();
if ((fromDate != “” && toDate != “”) && Date.parse(fromDate) > Date.parse(toDate)) {
// alert(“To date should be greater than From date.”);
$(‘#<%= lblErrorMsg.ClientID %>’).text(‘To date should be greater than From date.’);
return false;
}
}


Get Current Page Name Using Javascript

February 27, 2013

Using this script you can get the name of current page.

<script language=”javascript”>
function getPageName() {
var URL = window.location.pathname;

var PageName = URL.substring(URL.lastIndexOf(‘/’) + 1);
//alert(PageName);
return PageName;

}
</script>