我可以简单地得到一个数组的项目
string myKeyword="test";
GridView1.DataSource = from e in table where e.Keyword.Equals(myKeyword) select e;
Run Code Online (Sandbox Code Playgroud)
我怎么能把它扩展到一个数组?我想要的东西:
string[] myKeywords={"test1", "test"};
GridView1.DataSource = from e in table where e.Keyword.Equals(myKeywords) select e; // something like this?
Run Code Online (Sandbox Code Playgroud)
我想获得关键字等于myKewords中的一个关键字的所有元素
我有一个数组,我想在Angular.js中按日期排序:
<tr ng-repeat="er in vm.readerFeeds | orderBy:'-publishedDate'">
<td>{{er.publishedDate}}</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
该清单不是正确的.我认为日期格式是原因?
日期格式为:
Sat, 09 Nov 2013 04:26:55 -0800
Run Code Online (Sandbox Code Playgroud) 我想用角度2*ngFor列出以下json的状态和类型.还应呈现父母属性.
var test= {
'192-168-0-16':{
'ac395516-96d0-4533-8e0e-efbc68190e':{
'state': "none",
'typ': "test"
},
'ac395516-96d0-4533-8e0e-efbc68190e':{
'state': "none",
'typ': "dummy"
}
},
'222-21-12-12': {
'ac395516-96d0-4533-8e0e-efbc68190e': {
'state': "none",
'typ': "none"
}
}
Run Code Online (Sandbox Code Playgroud)
角度2:
<div *ngFor='#s of test'> <!-- also other properties should be visible -->
<div *ngFor='#t of s'>
{{t.state}} {{t.typ}}
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
当然这不起作用.没有很多数据转换是否可能?我不知道如何获取我的json数组.
<clipPath id="clip1">
<rect x="10" y="222" height="30" width="50" rx="5" />
</clipPath>
<image .... clip-path="url(#clip1)" />
Run Code Online (Sandbox Code Playgroud)
它切割图像的外部空间。但我想在图像上切一个洞。我怎样才能实现它?
在新的Visual Studio 2012 Webforms模板中,我的所有ASP.NET复选框和Radiobutton都在顶部或底部显示文本.
是故意的吗??我怎么能像往常一样对齐文本?我尝试禁用主题并将cssclass设置为复选框但没有任何更改.
找到的解决方案:我研究了firebug中的html,似乎默认的Microsoft CSS被破坏了(!)label {display:block; 导致错误的对齐
我想用德语抓取谷歌建议:
string url = "http://google.de/complete/search?output=toolbar&q=" + txtResults.Lines[i].Replace(" ", "%20%");
WebClient client = new WebClient();
client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0");
client.Headers.Add("Accept-Encoding:", "gzip, deflate");
client.Headers.Add("Connection:", "keep-alive");
doc.Load(client.OpenRead(url), System.Text.Encoding.UTF8, true);
Run Code Online (Sandbox Code Playgroud)
但我总是得到国际结果,而在浏览器中,我通过给定的 .de url 得到德国结果。所以我添加了标题:
client.Headers.Add("Accept-Language:", "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3");
Run Code Online (Sandbox Code Playgroud)
但现在我收到错误: 指定的值具有无效的 HTTP 标头字符
我还尝试通过以下方式设置我的应用程序的语言
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Run Code Online (Sandbox Code Playgroud)
但这也无济于事。
我有一个自动弹出窗口,可以在角度以外工作ng-repeat
.
<a href="#" class="tt1" data-trigger="hover" data-html="true" data-selector="" data-original-title="first tooltip" data-content="fldsfkjsdöflsj dlfödjs">Hover over me</a>
Run Code Online (Sandbox Code Playgroud)
一旦我在ng-repeat中使用它就会停止工作.我在角度控制器构造函数中初始化popover.
$('.tt1').popover();
Run Code Online (Sandbox Code Playgroud) 我需要动态标记一个上传按钮。到目前为止,我的代码:
<style>
.file_upload_wrap.background_file:before {
content: {{label}}; /* of course does not work */
}
</style>
<div class="file_upload_wrap background_file imgFormButton">
<input type="file" class="file_upload" (change)="uploadFile($event, file)" name="file" id="file" [(ngModel)]="model.file"
#file="ngModel">
</div>
Run Code Online (Sandbox Code Playgroud)
如何动态设置内容?
Uncaught TypeError: Object #<Object> has no method 'getInvoices'
当我调用this.getInvoices
ajax.error 结果时出现错误。如何从那里访问打字稿功能?
// Typescript
class InvoicesController {
...
public getInvoices(skip: number, take: number): void {
...
}
public createInvoice() {
$.ajax({
...
contentType: 'application/json',
type: 'POST',
success: function (res) {
if (res.result === 'ok') {
this.getInvoices(0,100); // THIS DOES NOT WORK?
}
},
error: function (err) {
this.getInvoices(0,100); // THIS DOES NOT WORK?
}
});
}
}
Run Code Online (Sandbox Code Playgroud)