小编Gig*_*m02的帖子

使用Sharepoint 2013 REST Api/CSOM检索发布图像字段

我们使用Sharepoint 2013 REST API从Sharepoint获取所有新闻项.我们制作了一个自定义的ContentType"Newsitem",其中包含一些属性,包括发布图像字段.

  var contentTypeId = "0x01100018B03AC7E8312648AEA00851DEDBCAF802";
  var standardUri = "https://examplesite.com/blog/_api/lists/getbytitle('Messages')/items?$top=7&$filter=startswith(ContentTypeId,'" + contentTypeId + "')";
  var selectiveUri = "https://examplesite.com/blog/_api/lists/getbytitle('Messages')/items?$top=7&$filter=startswith(ContentTypeId,'" + contentTypeId + "')&$Select=Title,Teaser,Body,ShowAt,TeaserImg";
Run Code Online (Sandbox Code Playgroud)

使用standardUri进行我的REST调用,我检索所有属性但没有TeaserImg.明确选择TeaserImg会使呼叫失败.

为什么我找不到TeaserImg,这不是可能的Sharepoint 2013 REST Api,我应该使用CSOM吗?

sharepoint sharepoint-2013 csom

10
推荐指数
2
解决办法
2万
查看次数

如何在Asp.NET中获取url响应值

我几乎敢问,但我如何获得URL的响应数据?我再也记不住了.

我的场景:我正在使用twitter api来获取用户的个人资料图片.该api url返回jpg位置.所以如果我真的在我的视图中写这个HTML:

<img src="https://api.twitter.com/1/users/profile_image?screen_name=twitterapi&size=bigger"/> 
Run Code Online (Sandbox Code Playgroud)

浏览器自动将响应jpg用于src popertie.像这样:

现在我的问题非常简单:如何在C#中获取.jpg位置以放入我的数据库?

c# asp.net twitter

9
推荐指数
2
解决办法
3万
查看次数

如何在(Umbraco)项目中设置visual studio来创建CSHTML文件

所以,我正在为我的Umbraco项目在Visual Studio中开发我的剃刀宏指令.一切都很好,但有两件事真的很烦人.

  • 如果我想创建一个新的CSHTML文件,最好的解决方案是复制现有文件.
  • 我没有完整的剃须刀IntelliSense,例如Html.Raw

有没有办法配置我的项目使用此功能?还没找到.cshtml模板.

umbraco razor

8
推荐指数
1
解决办法
2万
查看次数

Should I attach my .on('click') event to the document or element

Yesterday I was reading the jQuery docs for .on() where was stated:

Avoid excessive use of document or document.body for delegated events on large documents

But today, I was looking at this JSPERF and I notice a better perfomance when the click event is attached to the document.

So right now, i'm confused. The perfomance tests speak against the docs?

javascript jquery javascript-events

8
推荐指数
1
解决办法
172
查看次数

Web Essentials 2013上下文菜单不可用

由于我的解决方案中的一个项目使用NodeJS/Grunt来编译他的Less文件,因此我使用解决方案范围的WebEssentials-Settings禁用了Web Essentials中较少的编译.

  "Less": {
    "CompileOnBuild": false,
    "CompileOnSave": false,
    "GenerateSourceMaps": false,
    "MinifyInPlace": false,
    "OutputDirectory": null,
    "ShowPreviewPane": false,
    "EnableChainCompilation": false,
    "ProcessSourceMapsForEditorEnhancements": true,
    "StrictMath": false
  },
Run Code Online (Sandbox Code Playgroud)

但是,此解决方案中的一个遗留项目不会自动构建他的Less文件,因此我想右键单击该文件并从Web Essentials上下文菜单进行编译.可悲的是,整个菜单被禁用.是什么原因,我该如何解决这个问题?

less visual-studio web-essentials visual-studio-2013

6
推荐指数
0
解决办法
588
查看次数

jQuery DateTimePicker:使用jQuery $ .Post()将日期时间数据发布到MVC3动作中的ViewModel

我正在尝试使用jQuery DateTimePicker将我的日期从输入字段发布到我的ViewModel中的DateTime属性.我一直在解析1/01/0001 0:00:00.我们来看看我的viewmodel:

public class GameViewModel
{
    [Display(Name = "Home team")]
    public virtual String Home { get; set; }

    [Display(Name = "Away team")]
    public virtual String Away { get; set; }

    [Display(Name = "Kickoff time")]
    [DataType(DataType.DateTime)]
    public virtual DateTime GameTime { get; set; }

    [Display(Name = "Standard sharing on?")]
    public virtual Boolean IsStandardSharing { get; set; }

    //Hidden
    public virtual Guid PeriodId { get; set; }

}
Run Code Online (Sandbox Code Playgroud)

这是我输入字段的剃刀:

@Html.EditorFor(m => m.GameTime)
Run Code Online (Sandbox Code Playgroud)

最后是我的JavaScript

$('#GameTime').datetimepicker({
    constrainInput: true,
    firstDay: 1,
    monthNames: ['Januari', 'Februari', …
Run Code Online (Sandbox Code Playgroud)

c# jquery jquery-ui datetimepicker asp.net-mvc-3

3
推荐指数
1
解决办法
4090
查看次数

为什么Visual Studio会在nullity-checked Javascript Object中警告我'null'

我真的不明白为什么Visual Studio在下面执行"ra.split('')"时给出了警告"限定符可以是'null'或'undefined'",即使在我进行了无效检查之后.我有这个代码:

var ra = data.RiskAnalysis;
if (typeof ra !== "undefined") {
    var ebwg = ra.split('');
}
Run Code Online (Sandbox Code Playgroud)

正如你可以在这个stackoverflow-post中读到的那样,'typeof ra'如果值为null,则会返回'object'.

这是一个错误吗?或者我的支票不够?

javascript visual-studio visual-studio-2012

2
推荐指数
1
解决办法
1374
查看次数