请问vbscript怎样返回对象?
错误总是提示:
Microsoft VBScript 运行时错误 (0x800A01B6)
对象不支持此属性或方法
产生错在returnUser = other_User (已注明)
请问怎么解决?
<%
class User
private userName
private age
public property get getUserName()
getUserName = userName
end property
public property let setUserName(byVal uName)
userName = uName
end property
public property get getAge()
getAge = age
end property
public property let setAge(byVal uAge)
age = uAge
end property
end class
class UserDao
public function returnUser()
set other_User = new User
other_User.setUserName= "michael "
other_User.setAge = 25
returnUser = other_User '这里产生错误
end function
end class
set my_user = new User
set my_userDao = new UserDao
my_user = my_userDao.returnUser()
Response.Write my_user.getUserName()
%>
------解决方案--------------------set returnUser = other_User
返回对象要加set