首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

membershipProvider奇怪的有关问题

2012-01-20 
membershipProvider奇怪的问题?membershipProvider的每个方法和方法参数和方法输出值都定制好的,如何在Pro

membershipProvider奇怪的问题?
membershipProvider的每个方法和方法参数和方法输出值都定制好的,如何在Provider   增加自己方法,通过什么调用?
      如:对于
public   override   MembershipUser   CreateUser(   string   username,
                                                                                                      string   password,
                                                                                                      string   email,
                                                                                                      string   passwordQuestion,
                                                                                                      string   passwordAnswer,
                                                                                                      bool       isApproved,
                                                                                                      object   providerUserKey,
                                                                                                      out         MembershipCreateStatus   status   )

我想把passwordQuestion,passwordAnswer,isApproved,这些参数去了,而增加一些别的参数,如地址,电话,性别,手机还有邮编等等~




[解决办法]
可以在配置文件中加入新项啊。比如:
<properties>
<add name= "city " type= "string "/>
<add name= "street " type= "string "/>
<add name= "InceptNews " type= "string "/>
<add name= "birthday " type= "string "/>
<add name= "picwz " type= "string "/>


<add name= "salary " type= "string "/>
<add name= "smoke " type= "string "/>
<add name= "drink " type= "string "/>
<add name= "tel " type= "string "/>
<add name= "knowthis " type= "string "/>
<add name= "zine " type= "string "/>
<add name= "research " type= "string "/>
</properties>


然后通过以下去扩展:
Dim result As MembershipCreateStatus
Membership.CreateUser(userName, password, email, passwordQuestion, passwordAnswer, True, result)

Dim p As ProfileCommon = CType(ProfileCommon.Create(txtuser.Text, True), ProfileCommon)
p.sex = RadioButtonList1.SelectedValue
p.city = mydown1.Items.FindByValue(mydown1.SelectedValue).Text
p.street = Hid.Value
p.Save()

热点排行