我正在尝试在 aspx 页面的文件后面的代码中调试一些代码。我在页面和 web.config 中都将调试设置为 true。
有人可以告诉我为什么a)即使下拉列表已填充,断点也不会触发,b)为什么当我取消注释msgbox时它永远不会触发并且下拉列表不会填充。
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If IsPostBack Then
ddlCity.Items.Clear()
Dim context As New enerteckEntities()
'Dim query = context.DistinctCityFromZiptax(Convert.ToInt16(ddlState.SelectedValue))
Dim query = From c In context.ziptaxes Where c.StateID = ddlState.SelectedValue Order By c.City Select c.City, c.ZipTaxId
'MsgBox(query.Distinct().ToList())
ddlCity.DataSource = query.Distinct().ToList()
ddlCity.DataValueField = "ziptaxid"
ddlCity.DataTextField = "City"
ddlCity.DataBind()
End If
End Sub