有没有人知道找出项目中未使用的视图的方法?与Resharper或没有它.任何想法比写下所有的观点更容易,并通过所有控制器和手动检查是赞赏:)谢谢
例如,如果检查这两个扩展方法,唯一的区别是htmlAttributes的类型,因此您可以通过两种不同的方式传递htmlAttributes:
public static MvcHtmlString TextBoxFor<TModel, TProperty>(
this HtmlHelper<TModel> htmlHelper,
Expression<Func<TModel, TProperty>> expression,
IDictionary<string, object> htmlAttributes);
public static MvcHtmlString TextBoxFor<TModel, TProperty>(
this HtmlHelper<TModel> htmlHelper,
Expression<Func<TModel, TProperty>> expression,
object htmlAttributes);
Run Code Online (Sandbox Code Playgroud)
并以下列方式之一使用它们:
@Html.TextBoxFor(model => model.TagLine,
new { @placeholder = "We live to make art." })
@Html.TextBoxFor(model => model.TagLine,
new Dictionary<string, object> {
{ "placeholder", "We live to make art." } })
Run Code Online (Sandbox Code Playgroud)
我检查过MVC源代码,我知道在后台他们使用相同的方法,但是接受匿名对象的方法HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)用于使匿名对象成为字典.
在我看来,使用匿名对象的视图更清晰.你们觉得怎么样?使用匿名对象有什么缺点吗?
正如你在两张图片中看到的那样!我缺少布局,系统和模板.当我用sitecore rock打开它时,它说"已修改 - 必须序列化".我想知道是否有人之前有这个问题以及你如何解决它.


我有一个有趣/恼人的问题,在矩形边界内找到纬度和长标记.我相信我的两点在我的矩形边界内.但是你可以测试自己第一个选择的结果是假的而不是真的!
DECLARE @boundingRect varchar(1000)
DECLARE @maxLat VARCHAR(20)
DECLARE @minLong VARCHAR(20)
DECLARE @minLat VARCHAR(20)
DECLARE @maxLong VARCHAR(20)
set @maxLat ='-36.06631759541187'
set @minLong ='125.23310677812492'
set @minLat ='-44.43329881450396'
set @maxLong='167.04707162187492'
SET @boundingRect = 'POLYGON((' + @minLong + ' ' + @minLat + ', ' +
@maxLong + ' ' + @minLat + ', ' +
@maxLong + ' ' + @maxLat + ', ' +
@minLong + ' ' + @maxLat + ', ' +
@minLong + ' ' + @minLat + '))' …Run Code Online (Sandbox Code Playgroud) 我有一个基本的控制器,如下所示
public abstract class BaseController
{
protected ActionResult LogOn(LogOnViewModel viewModel)
{
SaveTestCookie();
var returnUrl = "";
if (HttpContext != null && HttpContext.Request != null && HttpContext.Request.UrlReferrer != null)
{
returnUrl = HttpContext.Request.UrlReferrer.LocalPath;
}
TempData["LogOnViewModel"] = viewModel;
return RedirectToAction("ProceedLogOn", new { returnUrl });
}
public ActionResult ProceedLogOn(string returnUrl)
{
if (CookiesEnabled() == false)
{
return RedirectToAction("logon", "Account", new { area = "", returnUrl, actionType, cookiesEnabled = false });
}
var viewModel = TempData["LogOnViewModel"] as LogOnViewModel;
if (viewModel == null)
{
throw …Run Code Online (Sandbox Code Playgroud) asp.net-mvc ×1
c# ×1
idictionary ×1
resharper ×1
sitecore ×1
sitecore7 ×1
spatial ×1
sql-server ×1
sqlgeography ×1
t-sql ×1