我正在尝试使用CreateUserWizard将自定义字段添加到用户配置文件。 我将该字段添加到web.config作为
<profile defaultProvider="SqlProvider"> <providers> <add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="db" applicationName="dbapp" /> </providers> <properties> <add name="Currency" defaultValue="HUF" allowAnonymous="true" /> </properties> </profile>
并在CreateUserWizard的模板中添加了一个列表框。我想将信息添加到CreateUserWizard_UserCreated事件中的配置文件中。我可以检索值,但我不知道如何检索新创建的用户的profilebase。
除非我遗漏了一些东西,这是完全可能的,因为你的问题缺乏细节,你应该能够打电话给 ProfileBase.Create(username,true) 获取个人资料。
ProfileBase.Create(username,true)