我有相对的图像路径
~/image/noimage.jpg
Run Code Online (Sandbox Code Playgroud)
我想读取字节数组以保存在数据库中,如果该组织的徽标不在db中
public byte[] org_logo(int myOrgId)
{
byte[] photo ;
var context = new mp_repositoryEntities();
var query = from o in context.organizations
where o.organization_id == myOrgId
select o.logo;
photo = query.FirstOrDefault<byte[]>();
if (photo == null)
{
photo = File.ReadAllBytes("~/image/noimage.jpg");
}
return photo;
}
Run Code Online (Sandbox Code Playgroud)
当我设置这个路径到asp图像控制,那么它工作正常.
logo.ImageUrl = "~/image/noimage.jpg";
Run Code Online (Sandbox Code Playgroud)
任何的想法 ?????
找不到类型或命名空间名称'Umbraco'(您是否缺少using指令或程序集引用?)
当我继承我的控制器时,我收到此错误
Umbraco.Web.Mvc.RenderMvcController
Run Code Online (Sandbox Code Playgroud)
我已经检查过在Visual Studio 2012中从NuGet安装umbraco时引用了umbraco.dll.
Intellisense允许我选择这个引用,但是当我编译代码时它会抛出这个异常,如下面的屏幕解释它.
所有其他umbraco工作得很好我设计了一些静态视图,母版页,宏等所有工作正常.

基本上我在渲染参数中使用多列表进行类别选择.所以我得到了所选项目的管道分离GUID并需要获取项目集合,是否有Sitecore api支持的任何方法而不是循环迭代.与任何内置的Sitecore方法相比,这在效率方面可能很昂贵.
我试图从sitecore 8.1中的代码创建自定义域的用户.我成功地使用以下代码创建用户:
[HttpPost]
public string RegisterUser(SurveyMonkeyUser userInfo)
{
string userId = "0";
string Domain = "website"; //to be taken from config
string ProfileItemId = "{7D473841-D585-43F6-9DF4-400313D945EC}"; //to be taken from config
if (!AccountExists(Domain + userInfo.Username))
{
string domainUser = string.Concat(Domain ,@"\", userInfo.Username.Replace(" ",""));
var user = Sitecore.Security.Accounts.User.Create(domainUser , "pass123");
user.Profile.ProfileItemId = ProfileItemId;
user.Profile.SetCustomProperty("FirstName", userInfo.FirstName);
user.Profile.SetCustomProperty("LastName", userInfo.LastName);
user.Profile.SetCustomProperty("Email", userInfo.Email);
user.Profile.SetCustomProperty("DateOfBirth", userInfo.DateOfBirth);
user.Profile.SetCustomProperty("Gender", userInfo.Gender);
user.Profile.SetCustomProperty("Location", userInfo.Location);
user.Profile.SetCustomProperty("Occupation", userInfo.Occupation);
user.Profile.SetCustomProperty("SectorEmployment", userInfo.SectorEmployment);
user.Profile.SetCustomProperty("Salary", userInfo.Salary);
user.Profile.SetCustomProperty("MaritalStatus", userInfo.MaritalStatus);
user.Profile.SetCustomProperty("MobileNumber", userInfo.MobileNumber);
user.Profile.Save();
user.Profile.Reload();
var username = user.Name;
userId …Run Code Online (Sandbox Code Playgroud) 我在dignostic页面上遇到了sitecore coveo安装问题
The remote server returned an error: (503) Server Unavailable. (Hide details)
System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
at System.Net.HttpWebRequest.GetResponse()
at Coveo.SearchProvider.Applications.StateVerifier.<>c__DisplayClassd.<GetRestEndpointState>b__c()
at Coveo.SearchProvider.Applications.BaseVerifier.VerifyComponent(Func`1 p_VerifyMethod, String p_ComponentName)
Run Code Online (Sandbox Code Playgroud)
虽然我在论坛上找到了与此相关的一些解决方案,但没有一个反映相同. https://answers.coveo.com/questions/1974/rest-endpoint-the-remote-server-returned-an-error-503-server-unavailable 使用提供的解决方案同样适用于未反映或修复的以下错误. https://developers.coveo.com/pages/releaseview.action?pageId=14058186

谢谢
我正在使用sitecore 8.1,并希望将sitecore的默认登录URL从http:// domain/sitecore/login更改为http:// domain/admin-login.我不想更改物理文件的结构,所以我只是在App_Config/sitecore.config中更新了以下设置
<site name="shell" ----- loginPage="/admin-login" ------/>
<site name="login" virtualFolder="/admin-login" physicalFolder="/sitecore/login" ------/>
现在我可以通过http:// domain/admin-login访问登录页面,但旧路径http:// domain/sitecore/login仍然存在可能是因为物理文件夹结构.
有什么想法吗 ?或者sitecore建议的最佳做法?

图01是数据库中的一个表,我想提取数据,如图02所示.
我应该使用哪个查询?
Col_1中的唯一元素应成为新表的列名,Col_2中的元素应成为如图02所示的值.