Hướng dẫn set model value in javascript mvc - đặt giá trị mô hình trong javascript mvc

47

Mới! Lưu câu hỏi hoặc câu trả lời và sắp xếp nội dung yêu thích của bạn. Tìm hiểu thêm.
Learn more.

Tôi muốn cập nhật giá trị mô hình trong JavaScript như dưới đây nhưng nó không hoạt động.

function updatePostID[val]
{
    @Model.addcomment.PostID = val;
}

trong chế độ xem dao cạo như hình dưới đây

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }

Bất cứ ai có thể cho tôi biết làm thế nào để gán giá trị mô hình trong javascript?

Jason Berkan

8.6456 Huy hiệu vàng29 Huy hiệu bạc39 Huy hiệu Đồng6 gold badges29 silver badges39 bronze badges

Hỏi ngày 23 tháng 4 năm 2013 lúc 16:24Apr 23, 2013 at 16:24

Điều này sẽ hoạt động

function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}

Sau đó có một trường ẩn hoặc điều khiển khác cho PostID

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]

Đã trả lời ngày 23 tháng 4 năm 2013 lúc 16:51Apr 23, 2013 at 16:51

CodingBizCodingBizcodingbiz

25.8k8 Huy hiệu vàng55 Huy hiệu bạc93 Huy hiệu Đồng8 gold badges55 silver badges93 bronze badges

3

Mô hình [@Model] chỉ tồn tại trong khi trang đang được xây dựng. Khi trang được hiển thị trong trình duyệt, tất cả những gì tồn tại là HTML, JavaScript và CSS.

Những gì bạn sẽ muốn làm là đặt postid vào một trường ẩn. Vì giá trị postid được cố định, thực sự không cần JavaScript. Một @HtmlHiddenFor đơn giản sẽ đủ.

Tuy nhiên, bạn sẽ muốn thay đổi vòng lặp foreach của mình thành một vòng lặp. Giải pháp cuối cùng sẽ trông giống như thế này:

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }

Đã trả lời ngày 23 tháng 4 năm 2013 lúc 16:25Apr 23, 2013 at 16:25

Jason Berkanjason BerkanJason Berkan

8.6456 Huy hiệu vàng29 Huy hiệu bạc39 Huy hiệu Đồng6 gold badges29 silver badges39 bronze badges

2

Hỏi ngày 23 tháng 4 năm 2013 lúc 16:24jQuery and an Ajax call to post the specific update back to your server with Javascript.

Điều này sẽ hoạt động

function updatePostID[val, comment]
{

    var args = {};
    args.PostID = val;
    args.Comment = comment;

    $.ajax[{
     type: "POST",
     url: controllerActionMethodUrlHere,
     contentType: "application/json; charset=utf-8",
     data: args,
     dataType: "json",
     success: function[msg] 
     {
        // Something afterwards here

     }
    }];

}

Sau đó có một trường ẩn hoặc điều khiển khác cho PostIDApr 23, 2013 at 17:01

Đã trả lời ngày 23 tháng 4 năm 2013 lúc 16:51Dan Esparza

CodingBizCodingBiz28 gold badges101 silver badges124 bronze badges

Marc đã hỏi vào ngày 24 tháng 10 năm 2018, & NBSP; 10: 04 AM24 Oct 2018, 10:04 AM

Tôi khá mới đối với MVC [và phát triển web nói chung] và tôi tiếp tục bắt gặp một số 'gotchas' dẫn đến hành vi bất ngờ. Tôi đang sử dụng Kendo UI cho ASP.NET MVC, tuy nhiên tôi chắc chắn 99% rằng vấn đề của tôi là do sự thiếu hiểu biết của tôi về JavaScript hoặc MVC thay vì bất cứ điều gì để làm với Kendo. Bạn sẽ có thể tái tạo vấn đề bằng cách sử dụng mã sau:
You should be able to reproduce the problem using the following code:

Models:

public

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
6
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
6
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
5
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
5
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
9public
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
9

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
5
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
5

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

public

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
function updatePostID[val, comment]
{

    var args = {};
    args.PostID = val;
    args.Comment = comment;

    $.ajax[{
     type: "POST",
     url: controllerActionMethodUrlHere,
     contentType: "application/json; charset=utf-8",
     data: args,
     dataType: "json",
     success: function[msg] 
     {
        // Something afterwards here

     }
    }];

}
2

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
6
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
6
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
5
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4 PostID6
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4 @Model4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
9public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4 @HtmlHiddenFor2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
5public @HtmlHiddenFor9

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

Controller:

public

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
function updatePostID[val, comment]
{

    var args = {};
    args.PostID = val;
    args.Comment = comment;

    $.ajax[{
     type: "POST",
     url: controllerActionMethodUrlHere,
     contentType: "application/json; charset=utf-8",
     data: args,
     dataType: "json",
     success: function[msg] 
     {
        // Something afterwards here

     }
    }];

}
2

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
02

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4 PostID6
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
05

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4 @Model4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
09
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
11

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
4 @HtmlHiddenFor2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
8
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
9
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
0
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
1
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
14

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
18
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
18

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public @HtmlHiddenFor9public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
21

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
25
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
25

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

public ____10 public8

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
29
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
30
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
31
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
32

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
34
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
35
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
36
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
34
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
35
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
36

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
28
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
38
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
38

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
34
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
41
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
36
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
34
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
41
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
36

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
05
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
45
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
46
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
36

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
51
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
51

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
09
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
11
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
56

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

View:

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
63

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
65
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
68
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
14
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
72
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
75
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
76
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
78
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
79

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
82
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
82
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
82
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
82
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
68
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
90
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
93
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
93

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
01
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
01

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4public
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
21
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
15
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
16
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
18
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
19
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
23
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
26
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
30
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
30

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
32
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
32

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
34
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
34

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
36
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
36

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
38
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
38

function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
39
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
40
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
40

function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
39
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
32
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
32

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
44
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
44

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
32
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
32

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
28
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
29
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
30
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
31
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
32
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
56
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
57
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
59
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
79

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
90
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
65
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
28
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
45
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
46
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
36

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
83
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
83
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
87
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
88
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
87
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
87
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
88
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
87
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
94
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
94
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73__
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
05
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
57
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
08
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
79

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73__
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
18
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
57
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
21
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
79

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73__
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
53
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
54
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
02
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
31
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
57
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
34
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
79

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
70
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
70
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
46

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
48
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
48

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
50
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
50

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
52
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
52

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
54
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
54

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
56
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
56

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
56

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
58

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
60
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
60

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
62
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
62

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
64

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
66
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
68
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
68

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
70
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
70

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
72
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
72

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
74
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
74

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
76
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
76

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
77

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
78

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
80
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
80

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
70
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
70

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
72
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
72

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
86
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
86

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
88
@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
88

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
77

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
70
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

DemopartyDetails Mẫu biên tập

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
93

@Html.Hidden["PostID", Model.addcomment.PostID]
//OR
@Html.HiddenFor[model => model.addcomment.PostID]
94

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
3

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
06
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
07
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
06
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
06
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
07
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
06
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
11
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
11

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
13

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
15
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
15

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
17
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
17

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
19
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
19

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
11
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
11

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
23
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
23

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
25
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
25

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
27
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
27

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
33
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
29
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
29

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
35
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
35

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
37
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
37

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
39
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
39

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
41
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
41

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
47
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
47
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
54
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
16__
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
54
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
16
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
57
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
19
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
62
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74______473
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
64
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
73
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
16
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
57
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
19
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
0
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
74
for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
81
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
20
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
83
function updatePostID[val]
{
    document.getElementById['PostID'].value = val;

    //and probably call document.forms[0].submit[];
}
12
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
4
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
2
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
86
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
98
foreach[var post in Model.Post]
{
    
Posted by : @post.Username
@post.Content
if[Model.loginuser == Model.username] { @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
66

for [int i = 0 ; i < Model.Post; i++]
{
    
Posted by : @Model.Post[i].Username
@Model.Post[i].Content
if[Model.loginuser == Model.username] { @Html.HiddenFor[model => model.Post[i].PostID] @Html.TextAreaFor[model => model.addcomment.Content] Add Comment } }
7

Khi chạy mã này, tôi có thể nhấp vào nút để thêm một bên mới, mẫu biên tập viên xuất hiện như mong đợi và tôi nhấn nút 'nam', nơi điền vào trường giới tính với "M".

Sau đó, tôi điền vào hai trường còn lại bằng dữ liệu "kiểm tra" và "người" chung trước khi xác nhận mục nhập và sau đó nhấn gửi. Tuy nhiên, những gì tôi tìm thấy khi tôi đặt một điểm dừng ở bộ điều khiển là mô hình được chuyển qua có giới tính được đặt thành NULL. Tên và họ ["Test" và "người"] được điền hoàn toàn. RandomData cũng được điền hoàn toàn như mong đợi.
What I find when I place a breakpoint at the controller however is that the model being passed through has the gender set to null. The first name and surname ["Test" and "Person"] are fully populated however. The randomData is also fully populated as expected.

Thật thú vị, nếu tôi quay lại và gõ thủ công một cái gì đó như "nam" vào lĩnh vực giới tính, thì bây giờ cũng được điền. Chỉ khi tôi cố gắng sử dụng JavaScript để đặt giá trị mà nó không có.

Mục tiêu cuối cùng là có một trường ẩn được tạo ra bởi JavaScript khi nhấn một nút, vì vậy nếu ai đó có thể chỉ ra sai lầm của tôi thì nó sẽ được đánh giá rất cao!

Làm thế nào để vượt qua giá trị mô hình trong JS?

Solution..
Đặt dữ liệu của đối tượng mô hình và chuyển nó đến chế độ xem dao cạo thông qua bộ điều khiển. ....
Bây giờ trên chế độ xem dao cạo, chúng ta phải xác định mô hình trước và sau đó sử dụng hệ thống. ....
Cuối cùng, mô hình truy cập dưới dạng định dạng JSON trong tệp javascript E-G khi nhấp vào nút setName gọi và mô hình chuyển cho chức năng ..

Làm thế nào để đặt giá trị trong trường ẩn trong MVC?

Tạo một trường ẩn trong ASP.NET MVC..
Ví dụ: Mô hình sinh viên.lớp công khai sinh viên {public int studentId {get;bộ;} chuỗi công khai StudentName {get;bộ;}}.
Ví dụ: HiddenFor [] trong Chế độ xem dao cạo.@Model sinh viên @html.hiddenfor [m => m.studentid].
Ví dụ: html.hidden [] trong chế độ xem dao cạo.@Model sinh viên @html.hidden ["studentId"].

Chúng ta có thể sử dụng mô hình trong JavaScript không?

Kiến trúc MVC rất hữu ích trong JavaScript vì nó cung cấp nhiều hơn là cho phép các nhà phát triển tạo mã mô -đun.Chẳng hạn, vì mô hình trong MVC trả về dữ liệu mà không cần định dạng, các thành phần tương tự có thể được gọi để sử dụng trong các giao diện khác nhau.Điều này cho phép tái sử dụng mã.. For instance, since the Model in MVC returns data without formatting, the same components can be called for use in different interfaces. This allows for code reusability.

Tại sao chúng ta sử dụng Hiddenfor trong MVC?

HIDDENFOR [] là một phương thức được đánh máy mạnh mẽ được giới hạn với lớp mô hình.Nó giao tiếp và gửi/nhận giá trị cho các thuộc tính lớp mô hình.Nói chung, nó chứa 2 tham số;Tên trường ẩn là thuộc tính mô hình và giá trị cho trường ẩn.

Bài Viết Liên Quan

Chủ Đề