Pages

Wednesday, May 13, 2009

Sample Web site using Ajax

Most of the time the user think that how to use the ajax in the application here are the sample application  using the ajax.

you just  need to install the Ajax extention in your application, you can download the Ajax dll from the official site of microsoft asp.net.


In this sample application, i hace taken a label and a button , while clicking on the button the time on the label  is changed but the page does not refreshed, here is the aspx page.




here i had taken the button inside the Update panel, the  main work is done by using this update pannel.

and here is the code for the Cs page..


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
            Label1.Text = "Current Time: " + System.DateTime.Now.ToLongTimeString().ToString();
            Label2.Text = "Originally loaded at: " + System.DateTime.Now.ToLongTimeString().ToString();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        
             Label1.Text = "Current Time: " + System.DateTime.Now.ToLongTimeString().ToString();
    
    }
}



Happy Coading

Anil Kumar Pandey
System Architect
Green Point Technology Services (India) Ltd.
Mumbai, Maharastra ,India

Wednesday, April 29, 2009

" Most Valuable Member Award "

This is a very big achivment for me as i have got the "MOST VALUABLE MEMBER" award from the leading dot net technicle site www.dotnetspider.com. I am a regular contributer of this site, and always willing to help all those people who are in need for assitsnece in there programming. DNS provide me the chance to help people, and DNS also encourage me time to time by awarding me the regular awards like "Member of the Week", "Member of the Month" & "Member of the Year".
 
                        So from now onwards i would like to contribute more and more for this community..
You can also see the list of all the winners at the following address : "Winners", and you all can visit my profile at DNS "MyProfile".

Thank you very much DNS..

Anil Kumar Pandey
System Architect
Green Point Technology (India) Ltd.
Mumbai, Maharshtra
INDIA

Thursday, April 23, 2009

Google can search you now!!!!


Good News,

Google has started a new service from today, where  you can upload ur profile.. if some one enters ur name then the name will be shown in the google search result..

This is really a good and intrested service started by goolge , i m very keen to do new thing so i just created my profile in google. so waht are u wating for, create ur own profile now and changed the way google searched you..... Please follow the link http://www.google.com/profiles/

u can see my profile at  http://www.google.com/profiles/sankkrit.

Enjoy :)

Thursday, April 16, 2009

Email validation in java script.


How to validate an Email by javascript in a ASP.NET page..

function ValidateEmail(ctl)
{
        var strEmail=null;
        var ReturnValue=null;
        strEmail= document.getElementById(ctl).value;
        strEmail= strEmail.replace( /^\s+/g, "" ); // strip leading
        strEmail= strEmail.replace( /\s+$/g, "" ); // strip trailing

        var at="@";
        var dot="."; 
        var lat=strEmail.indexOf(at); 
        var lstr=strEmail.length;
        var ldot=strEmail.indexOf(dot); 
            if (strEmail.indexOf(at)==-1)
            {
                ReturnValue=0;
            }
            else if (strEmail.indexOf(at)==-1 || strEmail.indexOf(at)==0 || strEmail.indexOf(at)==lstr)
            {
                ReturnValue=0;
            } 
            else if (strEmail.indexOf(dot)==-1 || strEmail.indexOf(dot)==0 || strEmail.indexOf(dot)==lstr)
            {
                ReturnValue=0;
            } 
            else if (strEmail.indexOf(at,(lat+1))!=-1)
            {
                ReturnValue=0;
            } 
            else if (strEmail.substring(lat-1,lat)==dot || strEmail.substring(lat+1,lat+2)==dot)
            { 
                ReturnValue=0;
            } 
            else if (strEmail.indexOf(dot,(lat+2))==-1)
            { 
                ReturnValue=0;
            }
            else if (strEmail.indexOf(" ")!=-1)
            { 
                ReturnValue=0;
            }
            if (ReturnValue=='0')   //Not Valid
            {
                return 0;
            }
            else    //Valid Email
            {
                return 1;
            }
    }

Thursday, April 9, 2009

Its Time TO laugh :)

Saap Ne Piya Bakri Ka Khoon ...
.
.
Waah! Waah!
.
.
Saap Ne Piya Bakri Ka Khoon ...
.
.
Waah! Waah!
.
.
.
Good Afternoon! Good Afternoon! Good Afternoon!!




1)
Tere Pyaar Mein Paagal Ho Gaya Peter ...
.
.
Waah! Waah!
.
.
Tere Pyaar Mein Paagal Ho Gaya Peter ...
.
.
Waah! Waah!
.
.
.
Ab Hero Honda Splendor, 80 km Prati Litre .. !!


2)
Bahaar Aane Se Pehle Fizaa Aa Gayii ...
.
.
Waah! Waah!
.
.
Bahaar Aane Se Pehle Fizaa Aa Gayii ...
.
.
Waah! Waah!
.
.
.
Phool Ko Khilne Se Pehle Bakri Kha Gayii .. !!

3)
Aatma Chhod Gayii Shareer Puraana ...
.
.
Waah! Waah!
.
.
Aatma Chhod Gayii Shareer Puraana ...

.
.
Waah! Waah!
.
.
.
Didi Tera Devar Deewana .. !!
5)
Yashomati Maiyya Se Bole Nandlala ....
.
.
.
Yashomati Maiyya Se Bole Nandlala ...
.
.
.
"Maa, Tata Sky Laga Daala To Life Jhingalala ..!!"

6)
Hoton Pe "Haan" Hai ...
Dil Mein "Naa" Hain ....

Hoton Pe "Haan" Hai ...
Dil Mein "Naa" Hain ...



Shashi Kapoor Kehta Hai: "Mere Paas Maa Hai ..."

7   )
Aapki Surat Mere Dil Mein Aise Bass Gayii Hai ...


.
.
Aapki Surat Mere Dil Mein Aise Bass Gayii Hai ...
.
.
.
Jaise Chhote Se Darwaaze Mein Bhens Phass Gayii Hai .. !!



Keep Smiling :)
Anil Kumar Pandey

Kontera