我有一个类型的变量FirstThreads List<Thread>
.
我正在尝试执行以下操作,但FirstThreads始终为null.
FirstThreads.AddRange(Threads.Skip<Thread>(PageIndex * PageSize)
.Take<Thread>(PageSize));
Run Code Online (Sandbox Code Playgroud)
我不能这样做:
FirstThreads = FirstThreads.AddRange(Threads.Skip<Thread>(PageIndex * PageSize)
.Take<Thread>(PageSize));
Run Code Online (Sandbox Code Playgroud)
你知道如何解决这个问题吗?
我有一个包含4个值的数组:
string[] selectedObject;
Run Code Online (Sandbox Code Playgroud)
如何在字符串中保存所有4个数组值,如:
string selectedObjects = "";
Run Code Online (Sandbox Code Playgroud)
我需要一个像这样的字符串:
selectedObjects = "123; 132; 231; 132;";
Run Code Online (Sandbox Code Playgroud) 我在类型的数据库中有图像值"image"
.在视图中保存的类型byte[]
我希望在我的asp.net mvc视图中将其显示为图像.最好的就像图像一样.保存图像时的值Model.ImageData.
我试图像这样解决它:
<img height="450px" width="330px" src="<%= historyItem.ImageData %>" alt="image" />
Run Code Online (Sandbox Code Playgroud)
但它不起作用.怎么做?
我有一些登录密码字段:
<input type="password" name="password" id="password" value="Password" maxlength="40" required style="width: 130px; font-size: 10px;" />
Run Code Online (Sandbox Code Playgroud)
作为输出我有密码字段,其值为"密码",显示就像 "********"
,
显而易见的.但我希望将其视为文本"密码",并在键入内部显示后********
.怎么做??
我在 jquery 中很新。这是来自智能向导的jquery :
/ Default Properties and Events
$.fn.smartWizard.defaults = {
selected: 0, // Selected Step, 0 = first step
keyNavigation: true, // Enable/Disable key navigation(left and right keys are used if enabled)
enableAllSteps: false,
transitionEffect: 'fade', // Effect on navigation, none/fade/slide/slideleft
contentURL:null, // content url, Enables Ajax content loading
contentCache:true, // cache step contents, if false content is fetched always from ajax url
cycleSteps: false, // cycle step navigation
enableFinishButton: false, // make finish button enabled …
Run Code Online (Sandbox Code Playgroud) 我有3个单选按钮:
<div id="step-1">
<h2 class="StepTitle">
<label style="font-weight: bold; color: #662819;" id="frage1"></label>
</h2>
<br />
<input type="radio" name="group1" id="antwort1" value="" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" />
<label id="antwort1fuerFrage1"></label>
<br />
<br />
<input type="radio" name="group1" id="antwort2" value="" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" />
<label id="antwort2fuerFrage1"></label>
<br />
<br />
<input type="radio" name="group1" id="antwort3" value="" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" />
<label id="antwort3fuerFrage1"></label>
</div>
Run Code Online (Sandbox Code Playgroud)
我试图读取单选按钮是否被选中,并保存一个值(需要1或/ 0),如下所示:
var frage1 = document.getElementById("frage1").innerHTML;
var antwort1 = …
Run Code Online (Sandbox Code Playgroud) JAVASCRIPT
for (var i = 0; i < surveyResults.resultsOfSurvey.length; i = i + 1) {
debugger;
var answer = surveyResults.resultsOfSurvey[i].correct;
var qId = surveyResults.resultsOfSurvey[i].id;
var newElement = document.createElement('div');
newElement.id = surveyResults[i];
newElement.className = "answer";
newElement.innerHTML = "Antwort ist: " + answer + "! Fragen ID ist: " + qId + ".";
document.body.appendChild(newElement);
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div id="contentForSurvey">
<div id="answers"></div>
Run Code Online (Sandbox Code Playgroud)
如何将我的for
循环中的div 插入到div中id="answers"
?
我喜欢有数组或对象:
[0]
text:"first"
id: 1
[1]
text:"second"
id: 2
[2]
text:"third"
id: 3
Run Code Online (Sandbox Code Playgroud)
得到自己:
1: first
2: 1
3: second
4: 2
5: third
6: 3
Run Code Online (Sandbox Code Playgroud)
这是我的javascript,目前正在为数组实现:
var numberOfQuestions = questionaireResult.numberOfQuestions;
var i;
var j;
var result = [];
for (i = 0; i < numberOfQuestions; i++) {
debugger;
var question = questionaireResult.questions[i].text;
var questionID = questionaireResult.questions[i].id;
for (j = 0; j < questionaireResult.questions[i].answers.length; j++) {
var text = questionaireResult.questions[i].answers[j].text;
var id = questionaireResult.questions[i].answers[j].id;
result.push(text, id); …
Run Code Online (Sandbox Code Playgroud) 我有一个包含12个条目的数组.我喜欢用标题对它们进行排序.许多文章都有相同的标题,我可以很容易,因为标题是相同的.最后我可能是3或4组.
我有非常小的JavaScript代码,因为我不知道我是否想用循环或其他方式.
使用Javascript
var totalGroups = [];
var actualGroup = [];
var contentarticles = articles.contentarticles,
article,
$out = $("#articlesOutput");
for (var i = 0; i < contentarticles.length; i++) {
if (!article || article.title != contentarticles[i].title) {
article = contentarticles[i];
document.getElementById('articleForNaviTopTitle').innerHTML = article.title;
document.getElementById('articleForNaviTopID').innerHTML = article.id;
var articlesOutput = [
'<li><a href="./certifiedTraining/id=', article.id, '/step=', i + 1, '">',
article.title,
'</li>'
].join("");
$out.append(articlesOutput);
}
}
// till this point all works fine, and a code above gives results in the image below. …
Run Code Online (Sandbox Code Playgroud) javascript ×5
c# ×4
arrays ×3
jquery ×3
asp.net-mvc ×2
html ×2
.net ×1
group-by ×1
image ×1
input-field ×1
object ×1
radio-button ×1
radio-group ×1
request ×1
selecteditem ×1
smart-wizard ×1
sorting ×1
string ×1
structure ×1
submit ×1