我需要<div>
使用'forumChild'类更改标记的CSS 类.它必须改变foreach循环的每3个循环.
有没有办法在控件内执行此操作?
<div class="Forum">
<p>The Forum</p>
@foreach (var item in Model)
{
<div class="ForumChild">
<img src="@item.Blog.Image.img_path" alt="Not Found" />
<br />
@foreach (var comment in item.Blog.comment)
{
var db = new ACapture.Models.ACaptureDB();
var Name = from p in db.Profile.AsEnumerable()
where (p.AccountID == comment.AccountID)
select p;
<section>
<div>
<a href="@Url.Action("Index", "Home")">@foreach (var y in Name)
{ @(y.FirstName + " " + y.LastName + ":");
}</a>
</div>
<div>
@comment.Commentation
</div>
</section>
}
</div>
}
</div>
Run Code Online (Sandbox Code Playgroud)
提前致谢
我不能把它分成小数.它的四舍五入值为0.
private void button24_Click(object sender, EventArgs e)
{
double x = 0;
x = 1 / 2;
ans.Text = x.ToString();
}
Run Code Online (Sandbox Code Playgroud)
当我调试时,x在发送到文本框'ans'之前为零.
我试过......字符串变量仍为零..
double x = 1/5;
string displayX = x.ToString("0.0000");
Run Code Online (Sandbox Code Playgroud)