Advertisement
touhid_xml

Looping array ASP.NET C#

Apr 2nd, 2013
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.67 KB | None | 0 0
  1. <%@Page Language="C#" %>
  2.  
  3. <script runat="server">
  4. String[] city= new String[7];
  5.    
  6.    void Page_Load(Object Sender, EventArgs e){
  7.         city[0] = "Dhaka";
  8.         city[1] = "Rajshahi";
  9.         city[2] = "Rangpur";
  10.         city[3] = "Sylhet";
  11.         city[4] = "Barisal";
  12.         city[5] = "Chittagong";
  13.         city[6] = "Khulna";
  14.        
  15.     }
  16.  
  17.    void show()
  18.    {
  19.        int i = 0;
  20.        
  21.        while(i<7){
  22.            Response.Write(city[i] + "<br /> \n");
  23.            i++;
  24.        }
  25.  
  26.    }
  27.    
  28.     </script>
  29.     <html>
  30.     <head>
  31.     <title>City List of Bangladesh</title>
  32.     </head>
  33.     <body>
  34.  
  35.     <% show(); %>
  36.  
  37.    </body>
  38.  
  39.     </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement