个人资料API [英] Profile API

查看:59
本文介绍了个人资料API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有问题.我想在网站上创建个人资料.但是我不能.


我在webconfig中添加了一些代码.

Hello all,

I have a problem.I wanna create a profile in a website.But I couldn''t.


I added some codes in webconfig.

<system.web>


<profile>
  <providers>
    <clear/>
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfilProvider"/>

  </providers>
  <properties>
    <add name="Name"/>
    <add name="Surname"/>
  </properties>
</profile>



继续.

但是我无法访问代码部分中的配置文件".请帮我



goes on.

But I could not access "Profile" in code part.Help me please

推荐答案

我猜您的设置缺少某些内容(ConnectionStringName 属性)(假设您有正确准备了所有其他内容,包括准备数据库的成员资格和个人资料):

I guess your setting is missing something (ConnectionStringName property) (Assuming that you have prepared all other things correctly including preparing the database for Membership and profile):

<profile>
  <providers>
    <add name="AspNetSqlProfileProvider"

         connectionStringName="Conn"

         applicationName="/"

         type="System.Web.Profile.SqlProfileProvider />
  </providers>
</profile>



并且,您应该在web.config, 中具有ConnectionStrings 设置,该设置应具有匹配的名称:



And, you should have a ConnectionStrings setting in the web.config, which should have a matching Name:

<configuration>
<connectionStrings>
  <remove name="Conn"/>
  <add name="Conn"

       connectionString="server=db;database=aspnet;integrated security=sspi;"

 />
 </connectionStrings>
 ...
</configuration>



此链接 [



This Link[^] has some detailed discussion about configuring Profile in Asp.net.


这篇关于个人资料API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆