我发现了一个关于sitecore管理页面的一个有趣的问题,如果我的webconашп目标设置为4.5框架是下一个
> compilation defaultLanguage="c#" debug="true" targetFramework="4.5"
> enablePrefetchOptimization="true"
Run Code Online (Sandbox Code Playgroud)
我得到了下一个错误:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The base class includes the field 'StartPage', but its type (System.Web.UI.HtmlControls.HtmlGenericControl) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlIframe).
Source Error:
Line 71: </div>
Line 72: <div id="SDN">
Line 73: <iframe id="StartPage" runat="server" allowtransparency="true" frameborder="0" scrolling="auto" …Run Code Online (Sandbox Code Playgroud) 您好我想知道从客户端调用WCF方法的可能性是什么会忽略区分大小写的属性名称(在客户端我使用JSON使用小写属性名称,但在服务器端使用大写).在这种情况下,WCF无法映射属性.是否可以使用一些WCF属性等?
public interface IMyWCF
{
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
bool UpdateUser(User user);
}
[Serializable]
[DataContract]
public class User : ICloneable
{
[DataMember]
[JsonProperty(PropertyName = "login")]
[StringLength(40, ErrorMessage = "The Login value cannot exceed 40 characters. ")]
[DefaultValue("")]
public String Login { get; set; }
[DataMember]
[JsonProperty(PropertyName = "id")]
public int UserId { get; set; }
}
Run Code Online (Sandbox Code Playgroud) 我想为创建单例类收集更多变体.你有没有可以根据你的意见向我提供C#中最好的创作方式.
谢谢.
public sealed class Singleton
{
Singleton _instance = null;
public Singleton Instance
{
get
{
if(_instance == null)
_instance = new Singleton();
return _instance;
}
}
// Default private constructor so only we can instanctiate
private Singleton() { }
// Default private static constructor
private static Singleton() { }
}
Run Code Online (Sandbox Code Playgroud) 有谁知道Sitecore Sitecore.MainUtil.SendMail功能有标准功能来写关于发送邮件的日志?是否可以打开它?或者我需要使用我的自定义日志吗?
谢谢.
我有下一个代码
public async Task<IEnumerable<MyTabel>> GetData()
{
try
{
var dbCtx = new myEntities();
return await dbCtx.MyTabel.ToListAsync();
//return await dbCtx.MyTabel.ToArrayAsync();
}
catch (Exception ex)
{
throw ex;
}
}
Run Code Online (Sandbox Code Playgroud)
我想知道什么是ToListAsync或ToArrayAsync方法更适合性能?有人知道吗 ?
谢谢.
UPDATE
对我来说,性能是eqval tp更少的内存使用,更快的查询时间,更高的并发性
我创建了一个发布者(在sql server 2008 r2上),创建事务复制并在订阅者sql实例(SQL Server 2012 Express)上创建了一个新数据库.在SQL Server 2012 Express上创建新订阅后.
但我的新数据库尚未通过同步更新.
在通过复制监视器的服务器SQL Server 2008 r2上,我可以看到状态是SQL Server 2012 Express的未初始化订阅,并且详细信息没有可用的复制事务.信息
我怎么解决它?
谢谢
sql-server replication sql-server-2008 transactional-replication
我有返回某个对象的可枚举列表的 Web Api 服务,但是我在客户端看到每个对象都有一些额外的 $id ?为什么我得到它?是什么原因 ?是否可以停用它?
我想在Sitecore 8 MVC上创建基于Razor的面包屑.我创建了一个页面模板,其中包含一些可用于它的属性.创建了视图渲染并将其添加到布局项(页面).我用while循环为这个渲染创建了一个cshtml文件
<ul>
@{
var parentItem = Html.Sitecore().CurrentItem;
while (parentItem != null)
{
if (parentItem["Include in breadcrumb"] != "0")
{
<li>@parentItem["Short Title"]</li>
}
parentItem = parentItem.Parent;
}
}
</ul>
Run Code Online (Sandbox Code Playgroud)
但它对我来说看起来不是很理想,我想使用Glass Mapper
我创建了一个具有祖先访问权限的类
public class Breadcrumb
{
[SitecoreQuery("ancestor-or-self::*[@#Include in breadcrumb#='1']", IsRelative = true)]
public virtual IEnumerable<Breadcrumb> Ancestors { get; set; }
[SitecoreField(FieldName = "Include in breadcrumb")]
public virtual bool IncludeIn { get; set; }
[SitecoreField(FieldName = "Short Title")]
public virtual string Title { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
但是我不知道怎么对sitecore"说"使用它来进行我的View渲染.我没有任何特定的页面控制器.
是否可以使用一些玻璃映射器与View渲染?
可以在sitecore中创建具有***名称的项目.这将允许处理任何页面名称.
如果创建*项目,还有一个(*)像子项目一样会是什么?
如果在bucket项下创建*项目会是什么?
c# ×5
sitecore ×4
asp.net ×2
asp.net-mvc ×1
glass-mapper ×1
iis-7.5 ×1
javascript ×1
razor ×1
reflection ×1
replication ×1
singleton ×1
sitecore-mvc ×1
sitecore6 ×1
sitecore8 ×1
sql-server ×1
wcf ×1