2008-11-04 43 views
0

我写了一个小网站,在努力学习vb.net和asp.net,相当满意,因此租了一些空间并上传它,它是用asp.net express edition 2008和sql server express ....我已经上传了它,并且我发现它是用.NET 3.5编写的,而我的主机只处理2.01 ...我已经对大部分内容进行了排序和修剪我的web.config文件回到基础,但基于我的窗体身份验证工作不基于窗体的安全和上传的asp.net网站

<compilation debug="true" strict="false" explicit="true"> 
     </compilation> 
     <authentication mode="Forms" /> 
    <customErrors mode="Off"/> 
    </system.web> 

它不断报告说,在SQL Server不支持远程访问......不知道是什么做下一步,我不必写我自己的安全例程吗?我有一个SQL服务器后端

感谢您的时间

克里斯

回答

1

您使用的是SqlMembershipProvider的给用户在数据库中存储的Joakim?检查您的配置文件的部分,并确保connectionStringName引用您的连接字符串的名称。

+0

欢呼声指出我的方向正确,但现在所有页面都直接指向我的登录页面......这不会让我登录......但至少它在正确的方向迈出了一步:-) – spacemonkeys 2008-11-04 20:08:43

1

如果probllem是,你不能访问你的SQL Server可能是您正在使用受信任的连接呢?

如果网站位于ISP网络上,并且您的SQL Server位于另一个网络上,则不可能正常工作。

然后你需要做的是看看你的connectionstring来改变它,这样你就可以在连接字符串中传递用户名/密码。注意:这在安全性方面并不是最佳的,但它是访问处于其他域的远程SQL Server的一种方式。

/

+0

您好感谢 正在使用的连接字符串是不是一个值得信赖的连接字符串(包含IP编辑部地址,用户名和密码)并且适用于网站上的所有其他页面,而不是asp.net认证/登录控件 – spacemonkeys 2008-11-04 08:02:14

0

干杯您的帮助的人,改变了我的web.config

<?xml version="1.0"?> 
<configuration> 
    <appSettings/> 
    <connectionStrings> 
    <add name="DatebaseConnectionString" connectionString="ohh wouldn't you like to know" /> 
    </connectionStrings> 
    <system.web> 
     <roleManager enabled="true" /> 
    <compilation debug="true" strict="false" explicit="true"> 
     </compilation> 
    <pages> 
     <namespaces> 
     <clear/> 
     <add namespace="System"/> 
     <add namespace="System.Collections"/> 
     <add namespace="System.Collections.Generic"/> 
     <add namespace="System.Collections.Specialized"/> 
     <add namespace="System.Configuration"/> 
     <add namespace="System.Text"/> 
     <add namespace="System.Text.RegularExpressions"/> 
     <add namespace="System.Web"/> 
     <add namespace="System.Web.Caching"/> 
     <add namespace="System.Web.SessionState"/> 
     <add namespace="System.Web.Security"/> 
     <add namespace="System.Web.Profile"/> 
     <add namespace="System.Web.UI"/> 
     <add namespace="System.Web.UI.WebControls"/> 
     <add namespace="System.Web.UI.WebControls.WebParts"/> 
     <add namespace="System.Web.UI.HtmlControls"/> 
     </namespaces> 
    </pages> 
     <authentication mode="Forms" /> 
    <membership defaultProvider="SqlProvider"> 
     <providers> 
      <add connectionStringName="DatebaseConnectionString" applicationName="pedalpedalpuffpuff.com" 
      enablePasswordRetrieval="false" enablePasswordReset="true" 
      requiresQuestionAndAnswer="true" requiresUniqueEmail="true" 
      passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" 
      name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" /> 
     </providers> 
    </membership> 
    <customErrors mode="Off"/> 
    </system.web> 
</configuration> 

而且所有工作的罚款