日期:2014-05-18  浏览次数:20573 次

错误1“lstRole”不是“admin_addUser”的成员。E:\WebSite\admin\addUser.aspx.vb1034http://localhost/srms/
Partial Class admin_addUser
  Inherits System.Web.UI.Page

  Protected Sub cuw_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles cuw.CreatedUser

  Dim lstRole As DropDownList = _
  CType(Me.cuw.CreateUserStep.ContentTemplateContainer.FindControl("lstRole"), DropDownList)

  Dim rolename As String = Me.lstRole.SelectdValue

  Roles.AddUserToRole(Me.cuw.UserName, rolename)

  End Sub
End Class


------解决方案--------------------
找不到lstRole?
------解决方案--------------------
查看你的前台页面红色出是否正确
<%@ Page language="VB" CodeFile="addUser.aspx.vb " AutoEventWireup="false" Inherits="admin_addUser" %>
------解决方案--------------------
Me.cuw.lstRole这样可不可以?
------解决方案--------------------
Me.cuw.FindControl("lstRole")取不取得到?