我有一个Intranet网站,我可以在本地机器上运行时获取用户的身份值.
System.Web.HttpContext.Current.User.Identity.Name.ToString().Substring(3)
Run Code Online (Sandbox Code Playgroud)
但是当我在IIS 8.5上部署它时,它发现它是空白的.
请帮我理解我哪里错了?
对于模拟,我们必须使用特定的用户名和密码.
Web.config文件:
<system.web>
<authentication mode="Windows" />
<customErrors mode="RemoteOnly" defaultRedirect="~/Pages/Error/Error.aspx" >
<error statusCode="404" redirect="~/Pages/Error/404.aspx" />
</customErrors>
<identity impersonate="true" userName="user1" password="pass1" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
IIS设置:
Windows authentication - Enabled
Impersonation - Enabled
Rest all disabled.
Default app pool - Integrated mode.
Run Code Online (Sandbox Code Playgroud) 我在我的母版页中有这个.我点击它时可以突出显示菜单,但是当网站打开并开始加载页面时,我无法突出显示网站的开始页面.输入是我的开始页面.
编辑:我在帖子后面看到了亮点消失了.我该怎样预防呢?
<script type="text/javascript">
$(document).ready(function () {
var url = window.location;
$('.navbar .nav').find('.active').removeClass('active');
$('.navbar .nav li a').each(function () {
if (this.href == url) {
$(this).parent().addClass('active');
}
});
});
</script>
<nav class="navbar navbar-default" style="margin-bottom: -20rem; clear: none; background-color: white; border-color: white;">
<div style="margin-left: 0px;">
<div class="navbar-header">
<img src="../../Images/_logo.png" width="130" height="40" style="margin-right: 30px;" />
</div>
<div id="myNavbar">
<ul class="nav navbar-nav" id="menusite">
<li class="active"><a id="A1" style="outline: 0;" href="<%= Page.ResolveUrl("~/Pages/Entry")%>" title="Entry">Entry</a></li>
<li><a id="A7" style="outline: 0;" href="<%= Page.ResolveUrl("~/Pages/Ideation")%>" title="Ideation">Ideation</a></li>
<li><a id="A3" style="outline: 0;" href="<%= Page.ResolveUrl("~/Pages/Search")%>" …Run Code Online (Sandbox Code Playgroud) 我使用这个http://jsfiddle.net/watson/Gsj27/3/小提琴来分配字段集.
但我无法显示该字段集的顶部边框.

<section style="width: 95%;">
<div id="one">
<fieldset style="border: solid; border-width: thin; height: 200px; border-color: #a8a8a8;">
<legend id="Legend10" runat="server" visible="true" style="margin-bottom: 0px; font-size: 12px; font-weight: bold; color: #1f497d;"> Project Summary </legend>
<div style="margin-bottom: 10px; margin-left: 10px;">
<asp:Table ID="table10" runat="server" CssClass="labels">
<asp:TableRow>
<asp:TableCell Style="width: 10%;">
Project ID:
<asp:TextBox runat="server" Width="25px" Height="23px"></asp:TextBox>
</asp:TableCell>
<asp:TableCell Style="width: 40%;">
Project Name:<sup style="color:red; font-size:10pt;">*q</sup>
<asp:TextBox runat="server" Width="90px" Height="23px"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Style="width: 10%;">
Project ID:
<asp:TextBox runat="server" Width="25px" Height="23px"></asp:TextBox>
</asp:TableCell>
<asp:TableCell Style="width: …Run Code Online (Sandbox Code Playgroud) 我无法在我的连接字符串中使用密码,密码中包含"&",我的服务会抛出500内部服务器错误.
当我从密码中删除"&"时,服务运行但显然我不会连接到数据库.
例如
< add name="conn" connectionString="Data Source=DFF1234;Initial Catalog=PONJ1;User Id=PPID1;Password=POu&3mjl@sdRTYu" providerName="System.Data.SqlClient" >
Run Code Online (Sandbox Code Playgroud) 为什么这些简单的查询返回不同的结果?只有差异@val.
查询#1:
DECLARE @val NVARCHAR
BEGIN
SET @val = '0320'
SELECT 1
WHERE CAST(SUBSTRING(@val, 3, 2) AS INT) + 2000 < YEAR(GETDATE())
END
Run Code Online (Sandbox Code Playgroud)
查询#2:
SELECT 1
WHERE CAST(SUBSTRING('0320', 3, 2) AS INT) + 2000 < YEAR(GETDATE())
Run Code Online (Sandbox Code Playgroud) 我有这个代码,它将日值设为1,2,3 ..而不是01,02,03 ..
(DateTime.ParseExact("20160416", "yyyyMMdd", CultureInfo.InvariantCulture))
Run Code Online (Sandbox Code Playgroud)
得到: 4/16/2016 12:00:00 AM.
我需要 04/16/2016 12:00:00 AM
我尝试过不同的文化,但没有任何效果.