【发布时间】:2010-05-10 23:57:12
【问题描述】:
所以我在 C# 中有这个工作,为什么它不能在 VB 中工作
public string[] CustomizedRoles()
{
int length = Roles.GetAllRoles().Length;
string[] arrRoles=Roles.GetAllRoles();
string[] customizedRoles= new string[length+1];
customizedRoles[0] = "";
for (int i = 1; i < length+1; i++)
{
customizedRoles[i] = arrRoles[i-1];
}
return customizedRoles;
}
asp:GridView....
asp:DropDownList ID="ddlOwnerRolesUpdate" runat="server" DataSource="" Height="25px" Width="177px" SelectedValue=''>
“所有者”在哪里是来自网格数据源的数据值
它在 C# 中运行良好。
在 Vb 中使用相同的 aspx,但它后面的代码不起作用。
Public Function CustomizedRoles() As String()
Dim length As Integer = Roles.GetAllRoles().Length
Dim arrRoles As String() = Roles.GetAllRoles()
Dim _customizedRoles As String() = New String(length + 1) {}
_customizedRoles(0) = " "
For index As Integer = 1 To length
_customizedRoles(index) = arrRoles(index - 1)
Next
Return _customizedRoles
End Function
谁能告诉我如何将字符串数组绑定到下拉列表,从 aspx 到 VB 中的代码
【问题讨论】:
标签: data-binding