RSS

U.S.A Postal Address Validation

30 Jun

To use USA Address validation

download DLL file and Code

https://skydrive.live.com/?cid=fcca6a631a7ce903

 web.config

<appSettings>

<!– set the “proxy” key value to the null string to turn off proxy –>

<!– e.g. 10.10.201.3:8080 –>

<add key=”proxy” value=””/>

<add key=”proxyUserName” value=””/>

<add key=”proxyPassword” value=””/>

</appSettings>

AddressValidator.aspx

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

<head runat=”server”>

<title>Address Verification For USA</title>

<script type=”text/javascript”>

function YahooWindow() {

var street = document.getElementById(‘<%=txtAddress.ClientID %>’).value;

var city = document.getElementById(‘<%=txtCity1.ClientID %>’).value;

var e = document.getElementById(‘<%=ddlState.ClientID%>’);

//For ModelWindow then uncomment below code

//            $(“#Address1″).fancybox({

//                ‘width’: ‘55%’,

//                ‘height’: ‘30%’,

//                ‘autoScale’: false,

//                ‘transitionIn’: ‘none’,

//                ‘transitionOut’: ‘none’,

//                ‘type’: ‘iframe’

//            });

var strV = e.options[e.selectedIndex].text;

//alert(city);

document.getElementById(‘Address2’).href = ‘AddressVerification.aspx?street=’ + street + ‘&city=’ + city + ‘&state=’ + strV + ”

//yahoowin = dhtmlmodal.open(‘yahoo’, ‘iframe’, ‘AddressVerification.aspx?street=’ + street + ‘&city=’ + city + ‘&state=’ + strV + ”, ‘Address Verification’, ‘width=400px,height=350px,center=1’);

//             $(“#Address1″).click();

//             return false;

}

</script>

</head>

<body>

<form id=”form1″ runat=”server”>

<div>

<table>

<tr>

<td class=”sub02″ width=”180px”>

Address:

</td>

<td>

<asp:TextBox runat=”server” ID=”txtAddress” CssClass=”input” />

<a href=”#” id=”Address2″ onclick=”return YahooWindow();”>[Verify Address] </a><a

href=”#” id=”Address1″></a>

</td>

</tr>

<tr>

<td class=”sub02″ width=”180px”>

City:

</td>

<td>

<asp:TextBox runat=”server” ID=”txtCity1″ CssClass=”input” />

</td>

</tr>

<tr>

<td class=”sub02″ width=”180px”>

State:

</td>

<td>

<asp:DropDownList runat=”server” ID=”ddlState” CssClass=”input”>

<asp:ListItem>–Select State–</asp:ListItem>

<asp:ListItem>AK</asp:ListItem>

<asp:ListItem>AL</asp:ListItem>

<asp:ListItem>AR</asp:ListItem>

<asp:ListItem>AZ</asp:ListItem>

<asp:ListItem>CA</asp:ListItem>

<asp:ListItem>CO</asp:ListItem>

<asp:ListItem>CT</asp:ListItem>

<asp:ListItem>DC</asp:ListItem>

<asp:ListItem>DE</asp:ListItem>

<asp:ListItem>FL</asp:ListItem>

<asp:ListItem>GA</asp:ListItem>

<asp:ListItem>HI</asp:ListItem>

<asp:ListItem>IA</asp:ListItem>

<asp:ListItem>ID</asp:ListItem>

<asp:ListItem>IL</asp:ListItem>

<asp:ListItem>IN</asp:ListItem>

<asp:ListItem>KS</asp:ListItem>

<asp:ListItem>KY</asp:ListItem>

<asp:ListItem>LA</asp:ListItem>

<asp:ListItem>MA</asp:ListItem>

<asp:ListItem>MD</asp:ListItem>

<asp:ListItem>ME</asp:ListItem>

<asp:ListItem>MI</asp:ListItem>

<asp:ListItem>MN</asp:ListItem>

<asp:ListItem>MO</asp:ListItem>

<asp:ListItem>MS</asp:ListItem>

<asp:ListItem>MT</asp:ListItem>

<asp:ListItem>NC</asp:ListItem>

<asp:ListItem>ND</asp:ListItem>

<asp:ListItem>NE</asp:ListItem>

<asp:ListItem>NH</asp:ListItem>

<asp:ListItem>NJ</asp:ListItem>

<asp:ListItem>NM</asp:ListItem>

<asp:ListItem>NV</asp:ListItem>

<asp:ListItem>NY</asp:ListItem>

<asp:ListItem>OH</asp:ListItem>

<asp:ListItem>OK</asp:ListItem>

<asp:ListItem>OR</asp:ListItem>

<asp:ListItem>PA</asp:ListItem>

<asp:ListItem>RI</asp:ListItem>

<asp:ListItem>SC</asp:ListItem>

<asp:ListItem>SD</asp:ListItem>

<asp:ListItem>TN</asp:ListItem>

<asp:ListItem>TX</asp:ListItem>

<asp:ListItem>UT</asp:ListItem>

<asp:ListItem>VA</asp:ListItem>

<asp:ListItem>VT</asp:ListItem>

<asp:ListItem>WA</asp:ListItem>

<asp:ListItem>WI</asp:ListItem>

<asp:ListItem>WV</asp:ListItem>

<asp:ListItem>WY</asp:ListItem>

</asp:DropDownList>

</td>

</tr>

<tr>

<td class=”sub02″ width=”180px”>

Zip:

</td>

<td>

<asp:TextBox runat=”server” ID=”txtZipCode” CssClass=”input” />

</td>

</tr>

</table>

</div>

</form>

</body>

</html>

AddressVerification.aspx

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

<head runat=”server”>

<title></title>

<style type=”text/css”>

body{ margin:0;

padding:0;

font-family:Arial, helventica, Verdana;

font-size:11px;

}

</style>

</head>

<body>

<form id=”form1″ runat=”server”>

<div  style=”text-align: left; vertical-align: middle;”>

<asp:Image runat=”server” id=”imgNo” ImageAlign=”AbsMiddle” ImageUrl=”~/images/no.jpg”></asp:Image>

<asp:Image runat=”server” id=”imgYes” ImageAlign=”AbsMiddle” ImageUrl=”~/images/yes.jpg”></asp:Image>

<asp:Label runat=”server” id=”lblVerification”></asp:Label>

</div>

<div  style=”text-align: left; padding-left:75px;”>

<asp:RadioButton runat=”server” id=”rdo1″ Text=”Give me some address suggestions” GroupName=”rdosug” AutoPostBack=”true”></asp:RadioButton><br />

<asp:RadioButton runat=”server” id=”rdo2″ Text=”The address I entered is correct” GroupName=”rdosug” AutoPostBack=”true”></asp:RadioButton> <br />

<asp:RadioButton runat=”server” id=”rdo3″ Text=”I will make my address corrections  ” GroupName=”rdosug” AutoPostBack=”true”></asp:RadioButton>

</div>

</form>

</body>

</html>

Advertisements
 
Leave a comment

Posted by on June 30, 2011 in Vb.Net

 

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: