我试图让用户在注册时填写个人资料选项。我默认使用 asp.net 附带的提供程序。
示例:用户填写此注册表:
Username
Email
Age <- This is what I have tried to add in.
Password
Confirm Password
通过执行以下操作,我得到了出现的年龄。
1)将以下代码添加到Web.config
<properties>
<add name="Word" type="String" />
<add name="Age" type="Int32" defaultValue="0" />
</properties>
2)将以下代码添加到我的register.aspx视图中
<div class="editor-label">
<%: Html.LabelFor(m => Profile.Age) %>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(m => Profile.Age)%>
<%: Html.ValidationMessageFor(m => Profile.Age)%>
</div>
我去运行它,我填写了表格并点击了注册。我懂了:
超时已过。在操作完成之前超时时间已过或服务器没有响应。
和
第 127 行:_provider.CreateUser(userName, password, email, null, null, true, null, out status);
所以这就是我所做的,这可能都是错误的。做这个的最好方式是什么?