Option Strict Off Public Class WebForm1 Inherits System.Web.UI.Page Private syokinen As Integer = 2015 Private syuuryounen As Integer = 2020 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ddList2.Items.Add("ss") For j = syokinen To syuuryounen ddList2.Items.Add(j) Next End Sub End Class
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication27.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> </head> <body> <form id="form1" runat="server"> <div> <br /> <br /> <br /> <asp:DropDownList ID="ddList2" runat="server"> </asp:DropDownList> <br /> <br /> <br /> </div> </form> </body> </html>