我想从 RouteTable 检索路由值,但它为空。有人可以帮忙吗?
public static class GetRouteValues
{
public static string GetSomeValue()
{
RouteCollection routes = RouteTable.Routes;
var value = routes["somevalue"].ToString();
return value;
}
}
Run Code Online (Sandbox Code Playgroud)
我想检索此值以在 global.asax 文件中使用,并将其设置为某些路由值的默认值。
string value = GetRouteValues.GetSomeValue();
routes.MapRoute(null,
"{_value}/home",
new
{
_value = value,
controller = "home",
action = "index"
});
Run Code Online (Sandbox Code Playgroud) 我从sadegh用户在Windows 7 Ultimate上安装了SQL Server 2008 Enterprise Edition.
此帐户存在于管理员角色中.几天后我从Windows中删除了sadegh用户,现在我正在使用管理员用户.但我无法使用Windows身份验证方法登录到SQL Server数据库引擎,我收到此错误消息:
标题:连接到服务器
无法连接到SADEGH-PC.
附加信息:
用户'Sadegh-PC\Administrator'登录失败.(Microsoft SQL Server,错误:18456)
如需帮助,请单击:http: //go.microsoft.com/fwlink?ProdName = Microsoft + SQL + Server&EvtSrc = MSSQLServer&EvidID = 18456&LinkId = 20476
请帮我!谢谢
将我们的应用程序静态内容托管在一个完全不同的域上,而不是像其他域一样托管在我们主域的子域上有什么好处吗?例如,微软使用i.microsoft.com,谷歌使用gstatic.com,雅虎使用yimg.com,Stackoverflow使用sstatic.net
提前致谢
如何在ASP.NET MVC 3 beta 1中停止编码字符串?
我想防止删除特定记录。此触发器适用于该特定记录。但是,其他记录在删除时仍然保留。为什么?
ALTER TRIGGER [Globalization].[CountriesTracker]
ON [Globalization].[Countries]
INSTEAD OF DELETE
AS
BEGIN
SET NOCOUNT ON;
IF ((Select COUNT(*) from [Deleted]
Where [Deleted].[CountryId] = '36bd1536-fb56-4ec4-957e-1b3afde16c56') = 1)
BEGIN
RAISERROR('You can not delete this specific record!', 0, 0)
ROLLBACK TRANSACTION
RETURN
END
END
Run Code Online (Sandbox Code Playgroud)
如何确保不符合上述条件的行按预期被删除?
我有一个问题,但也许这实际上不是问题!为什么即使使用 Arial 等标准字体,下面的 HTML 标记也会生成似乎不正确的结果?
\n\n<span>\xd8\xb3\xd9\x84\xd8\xa7\xd9\x85</span><span>\xd8\xae\xd8\xaf\xd8\xa7\xd8\xad\xd8\xa7\xd9\x81\xd8\xb8</span>\nRun Code Online (Sandbox Code Playgroud)\n\n\xd8\xb3\xd9\x84\xd8\xa7\xd9\x85\xd8\xae\xd8\xaf\xd8\xa7\xd8\xad\xd8\xa7\xd9\x81\xd8\xb8
\n\n上面的输出不应该是这个吗?(忽略用于模拟的空间)
\n\n\xd8\xb3\xd9\x84\xd8\xa7\xd9\x85 \xd8\xae\xd8\xaf\xd8\xa7\xd8\xad\xd8\xa7\xd9\x81\xd8\xb8
\n\n我也使用了标签的边距,但有同样的问题。\n提前致谢;)
\n我们在Windows中使用VisualSVN Server作为SVN服务器.但它在管理权利方面的能力非常有限.此外,我们无法使用svn_access_file,因为我们的用户将使用Windows身份验证方法进行身份验证.
是否有任何工具来管理使用/支持Windows身份验证的权限?
如何在Visual Studio中隐藏IntelliSense的用户控件属性?
我想在单词列表中删除一些漂亮的单词.
public System.String CleanNoiseWord(System.String word)
{
string key = word;
if (word.Length <= 2)
key = System.String.Empty;
else
key = word;
//other validation here
return key;
}
public IList<System.String> Clean(IList<System.String> words)
{
var oldWords = words;
IList<System.String> newWords = new string[oldWords.Count()];
string key;
var i = 0;
foreach (System.String word in oldWords)
{
key = this.CleanNoiseWord(word);
if (!string.IsNullOrEmpty(key))
{
newWords.RemoveAt(i);
newWords.Insert(i++, key);
}
}
return newWords.Distinct().ToList();
}
Run Code Online (Sandbox Code Playgroud)
但我不能添加,删除或插入列表中的任何东西!发生异常NotSupportedException >> Collection的大小固定.我如何修改或添加新项目到通用的字符串列表?
这是我正在使用的代码,但是编译器说:匿名类型不能具有相同名称的多个属性
context.MapRoute("RouteName", "statics/category/{fileName}",
new
{
controller = "myController",
action = "Index"
},
new
{
fileName = new fnRouteConstraint(),
fileName = new AnotherRouteConstraint()
});
Run Code Online (Sandbox Code Playgroud) c# ×2
.net ×1
asp.net-4.0 ×1
asp.net-mvc ×1
authz ×1
cdn ×1
constraints ×1
css ×1
farsi ×1
html ×1
intellisense ×1
performance ×1
persian ×1
properties ×1
routes ×1
routetable ×1
seo ×1
sql ×1
sql-server ×1
svn ×1
triggers ×1
windows ×1