Retrieving Updated List Of Countries States And Cities In A Website?
Mar 4, 2010
I'm trying to create a User Registration page in ASP.NET and wondering what is the best way to get the list of up-to-date Countries and Cities? Are there any Web Services on the web that I can use to retrieve such information? If not, what are the options?
View 2 Replies
Similar Messages:
May 3, 2010
i want a list of all countries and states for free interms of xml,html,word,doc,notepad, .sql format..
View 8 Replies
Apr 20, 2010
I have a country table that has a list of countries. However, instead of just displaying the list alphabetical, I need to list the United States first, and then all the other countries in Alphabetical order. My select statement is pretty simple, jsut don't know how to get the US listed first...
Select Country from tCountry order by Country
View 4 Replies
May 19, 2010
I need a dropdown to display respective states when specific country is selected similarly for cities. I kept 3 dropdowns for country, state and city with 3 different tables with primary, foreign key constraints and stored procedures. The Stored Procedure is as shown ALTER PROCEDURE [dbo].[Usp_countryselect]
WITH
EXECUTE AS CALLER
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SELECT [country_id], [country_name]
FROM country
Similarly for states and city.
The code for populate lists is as shown
public class PopulateLists
{
public int FillCountry(ref System.Web.UI.WebControls.DropDownList drpdown)
{
SqlDatabase db = new SqlDatabase();
DbCommand cmd=db.GetStoredProcCommand("USP_countryselect");
DataSet dsCountry= db.ExecuteDataSet(cmd);
drpdown.DataSource =dsCountry.Tables[0] ; drpdown.DataTextField=dsCountry.Tables[0].Columns["country_name"].ToString() ;
drpdown.DataValueField = dsCountry.Tables[0].Columns["country_id"].ToString() ;
drpdown.DataBind();
return 1;
}
public int FillState(ref System.Web.UI.WebControls.DropDownList drpdown)
{
SqlDatabase db = new SqlDatabase();
DbCommand cmd = db.GetStoredProcCommand("USP_statesselect");
DataSet dsStates = db.ExecuteDataSet(cmd);
drpdown.DataSource = dsStates.Tables[0];
drpdown.DataTextField = dsStates.Tables[0].Columns["state_name"].ToString();
drpdown.DataValueField = dsStates.Tables[0].Columns["state_id"].ToString();
drpdown.DataBind();
return 1;
}
.
.
.
}
protected void Page_Load(object sender, EventArgs e)
{
BindDropdowns();
}
protected void BindDropdowns()
{
PopulateLists objPopulateLists = new PopulateLists();
int bytReturn;
bytReturn = objPopulateLists.FillCountry(ref Drpcountry);
bytReturn = objPopulateLists.FillState(ref Drpstate);
bytReturn = objPopulateLists.FillCity(ref Drpcity);
}
But in the output screen it is displaying all the values in the dropdowns irrespective of country and state selection.
View 3 Replies
Jul 22, 2010
where can i get the script for the countries and there corresponding states of all over the world.
As by googling I could Only find the states of Uk and USA but I want the states of all over the world and there corresponding countries.
View 2 Replies
May 4, 2010
How to bound countries list using DropDown list in VB ASP.Net?
View 9 Replies
Oct 22, 2010
Im looking for the functionality seen in most commercial websites like google maps to get approximate distance between cities and zip codes. Im guessing these sites are using huge databases with all this information already in them. It would be interesting to learn how to create this functionality myself but Im sure that would require a great deal of time. So Im looking for a package where someone has already done the work(an API) that would allow me to enter two different zip codes or maybe two different city,state combinations and take actions from there.
View 5 Replies
Jan 30, 2010
The task is this: Create custom AJAX method with option to call server side ASPX page and predefined Web Service: a.) Get all cities from ASPX page by given Country Code. For ex. send country code "US" to get a result of a unknown number of cities such as "Washington", "New York", "Houston" etc. with their corresponded ZIP codes (1000, 1100, 1200 etc); b.) Call a web service, posting ZIP code which returns does the code represent palindrome string (A number that reads the same whether written forwards or backwards).
View 1 Replies
Feb 9, 2010
I want to list all the countries in my dropdown list. where can i get all the names? from service right? How to do this?
View 4 Replies
Apr 21, 2010
I have 2 listboxes. 1 listbox displays all countries. then I have added 2 buttons, Add and Remove, to add and remove the selected countries from first listbox to second listbox. how can I move selected countries from one list box to another listbox in MVC framework.I am using Linq.
View 4 Replies
Feb 17, 2010
Plz go through my code-
<asp:ScriptManager runat="server"/>
<cc1:ModalPopupExtender ID="mpe_AddState" runat="server" PopupControlID="PanelAddState" TargetControlID="btnAddNew" BackgroundCssClass="ModalPopupBG" OkControlID="btnOk"
CancelControlID="btnCancel" BehaviorID="ModelPopUp_AddState">
</cc1:ModalPopupExtender>
<!-- Begin of Content table -->
<table width="100%" border="0" cellspacing="2" cellpadding="2" align="left">
<tr> <td>
<!-- Begin of Search Country Panel -->
<asp:Panel runat="server" DefaultButton="btnSearch">
<table border="0" cellspacing="3" cellpadding="3" align="left">
<tr> <td width="15%" >Search</td> <td width="30%">
<asp:TextBox runat="server" CssClass="textBox" ></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv_txtSearch" runat="server" ErrorMessage="Field can't be left Blank" SetFocusOnError="true" ControlToValidate="txtSearch" Display="None" ValidationGroup="search"> </asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtender runat="server" TargetControlID="rfv_txtSearch">
</cc1:ValidatorCalloutExtender> </td> <td width="25%">
<asp:Button runat="server" Text="Search" ValidationGroup="search" />
</td> </tr> <tr> <td width="15%">Country</td> <td width="30%">
<asp:DropDownList id="ddlCountry" runat="server" AutoPostBack="true" Height="30px" Width="76px">
</asp:DropDownList> </td> <td width="15 %">
<asp:Button runat="server" Text="AddNew" /> </td>
<td width="25%"></td> </tr> <tr> <td> </td> </tr>
</table> </asp:Panel>
<!-- End of Search Country Panel -->
<!-- Begin of Add State Panel -->
<asp:Panel runat="server" CssClass="formTextBold"
style="width:390px; height:500px; cursor: move;" Height="278px" Width="335px">
<div> <table border="0" > <tr><td></td></tr> <tr bgcolor="skyblue">
<td colspan ="3" style ="font-weight :bold "> Enter The State Details
</td> <td align ="center"><a href="#" onclick ="HidePopup();">
<font color="red" size="+1">X</font> </a> </td> </tr> <tr> <td> </td> </tr> <tr>
<td> </td> <td> State Code </td> <td>
<asp:TextBox id="txtStateCode" runat="server"></asp:TextBox>
</td> </tr> <tr> <td> </td> <td >State Name</td> <td>
<asp:TextBox id="txtStateName" runat="server"></asp:TextBox>
</td> </tr> <tr> <td> </td> </tr>
<tr> <td> </td> </tr> <tr> <td> </td>
<td >Country Name</td> <td>
<asp:DropDownList id="ddlSelectCountry" runat="server">
</asp:DropDownList></td> <tr> <td> </td> </tr>
<tr> <td> </td> </tr> <tr>
<td width="28%" colspan="2"></td> <td >
<asp:Button runat="server" Text="Ok" Width="50px" />
<asp:Button runat="server" Text="Cancel" /> </td>
</tr> </tr> </table> </div> </asp:Panel>
<!-- End of Add Country Panel -->
.cs code is-
protected void Page_Load(object sender, EventArgs e) {
if(!IsPostBack) {
ddlSelectCountry.DataSource = Obj_BLogic.Country_List();
ddlSelectCountry.DataTextField = "Country_Name";
ddlSelectCountry.DataValueField = "Country_Id";
ddlSelectCountry.DataBind(); }
ddlCountry.DataSource = Obj_BLogic.Country_List();
ddlCountry.DataTextField = "Country_Name";
ddlCountry.DataValueField = "Country_Id"; ddlCountry.DataBind();
ddlCountry.Items.Insert(0, new ListItem("Select"));
grdState.Columns[0].Visible = false; }
I want list of countries exactly once in both the dropdownlist (ddlCountry & ddlSelectCountry). But is giving the list of countries twice.
View 1 Replies
Mar 17, 2011
I built a user control that displays a drop down list of states. I'm using it, but if I try to put it in a listview control, all I get is the frop down with nothing in it.
View 3 Replies
May 28, 2010
I have a web page, contains dropdownlist loading it with customers table using SQL datasource.
In the same web page i am creating a new customer, on clicking customer add it is creating a new row in customer table but the Customer Dropdown list is not getting updated.
I have added dropdown.databound() in the CustomerAdd button click event after creating the customer in the table.
View 5 Replies
Aug 17, 2010
I am trying to write a web page where i have to select an item form a drop down list.
I am using linq to sql to get the data from the database.the strange thing is that i can register the data to the drop down list but when i select one of them the drop down list lets me to the first item. I set post back = true because i want to update the page every time an item get selected. I wrote a really simple code to check what was going wrong but still...no success. Below i am bringing the code i wrote.
.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication7.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[Code]....
View 8 Replies
Feb 3, 2010
I have a long running asynchronous process which returns a total of around 10-100 results over a 5 minute period. I want to update the page with the progress of the job and also show each result on the page in a list that grows dynamically as results are returned, all without any postback or page refresh.
View 6 Replies
Aug 30, 2010
I am trying hard to update a business object inside a List<>.
I am using a checkbox list
When a checkbox list item is clicked I check if it exists, if yes I mark it as Dirty (means the user unchecks an item)If not, I add a new item to the list (means the user clicks a new item)and store it in view state
How do I update the Generic List with the Dirty Object ?
On form update, do I foreach and make separate lists of dirty and new objects to send to DB layer or would you recommend any other way ?
Here is my code.
protected void cblExclusions_SelectedIndexChanged(object sender, EventArgs e)
{
if (cblExclusions.SelectedIndex != -1)
{
ftExclusions myExclusion=new ftExclusions(); // Business object
[Code]....
View 1 Replies
Apr 6, 2010
I would like to add code in a program that determines when a website was last updated. Ideally you would give the code a URL of a website and it would return a DateTime that the website was last updated.Is there a way to do this using.NET.
View 3 Replies
Aug 9, 2010
I have a photo website with a login page. (It is an exercise out of a book: Scott Mitchell's "ASP.Net in 24 hours".) After a user logs in he can go to another page and manage photo categories. That page works. I have two users that have photo categories setup in the database.
There is also a page where a user can add photo images. This is the page that is giving me problems. It has a name and description field. (The functionality for uploading a photo is next in the book. It is not on the page yet.) The page also has a dropdown list that is supposed to be populated by the category names of the logged in user. This is the control that is giving me problems. It is not being populated by the logged in user's Category names.
The two database tables used are pretty simple:
[code]....
There are two SQLDataSources on the page:
One is for inserting new photos. The other retrieves the Categories of the current user. The page has a DetailsView with the Photo's Title and Description. There is also a dropdown list with the Category names. It is aa InsertItem Template in DetailsView.
When the page opens, the current UserID is retrieved and put into a Hidden Field. It is then used to retrieve the Category Names by the second SQLDataSource. I have gone through the book's steps a few times now. The dropdown list is not being populated. I am not getting any errors.
How can I track down why the dropdown list is not being populated?
Both of my users have Category values set up in the database. So, the dropdown list has values that should be appearing.
Here is the source code:
[Code]....
View 3 Replies
Jun 4, 2010
I have a ListView inside my UserControl which is showing a list of posts from the table named posts. I've also got a category table which is full of the categories. I then have another table which contains the PostID and the CategoryID so that posts can have multiple categories. I was wondering, in my ListView at the moment I only have a list of the posts but I would like to add, for every post in the listview, the cateogires it is in.
View 12 Replies
Jun 3, 2010
Is it possible to retrieve/get the html source code of a certain website and use it in a ASP.NET web application to display them? (without using the copy-paste, of course)
I want my ASP.NET web application to use them as part of a code sample feature I currently working on.
I'm also considering working it on PHP.
View 3 Replies
Oct 5, 2010
My last two questions were about sending email through ASP.NET, and adding web form to that email body, which is working :)
This time my boss wants me to send email addresses from our exchange server global address list. :(
For example,
Dropdownlist for send from who, Dropdownlist for recieving person...The behind values should be email addresses.
And this information should come from global address list on our exchange server.
View 5 Replies
Mar 23, 2011
m trying fill the combo box from cities database but i wan the metropolitan cities at the top of the selection menu i have used this approach i there any alternative??
[Code]....
and the combo box in designer
<div class="row">
<label>
City :</label>
<ajaxToolkit:ComboBox ID="ddCities" runat="server" AutoPostBack="False"
DropDownStyle="DropDownList"
AutoCompleteMode="SuggestAppend"
CaseSensitive="False"
CssClass=""
ItemInsertLocation="Append" Width="380px"></ajaxToolkit:ComboBox>
am achieving the purpose but it doesn't seems ideal since hard coded and also entries are repeated
View 1 Replies
Sep 16, 2010
Just wondering how to implement a user's list into website ? im using ASP.NET C#. I want to be able to:
add/delete usersadd/remove roles
View 2 Replies
Mar 6, 2010
i have two dropdownlis for showing State and City. when i select a state i want to show city's state.
how can i send value's state to controller and return list of city to view.
View 4 Replies
Nov 21, 2010
Here is my code. I just wanted to update one column. Why is everything getting NULL put into it?
[Code]....
[Code]....
View 5 Replies