当前位置: 代码迷 >> ASP.NET >> 异常1“lstRole”不是“admin_addUser”的成员。E:\WebSite\admin\addUser.aspx.vb1034http://localhost/srms/
  详细解决方案

异常1“lstRole”不是“admin_addUser”的成员。E:\WebSite\admin\addUser.aspx.vb1034http://localhost/srms/

热度:10784   发布时间:2013-02-25 00:00:00.0
错误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")取不取得到?
  相关解决方案