Xceedas

Xceedas
xceedas

Monday 22 September 2014

Display Country List Without Database in ASP.Net C#

Use the following source code in the default.aspx <body> section page as: 

<body>
    <form id="form1" runat="server">
    <div class="div" align="center">
    <br /> <br />
        <asp:DropDownList ID="DropDownList1" runat="server" Width="100px">
        </asp:DropDownList>
    </div>
    </form>
</body>

Then switch to view code and create the following method in the default.aspx.cs to get the country list using Globalization:
countrylistMethod.png

Now call the preceding method on page load with the dropdonlist to bind the country list as:
CallingMethod.png

No comments :