Confirm the use of the box. A confirmation box pops up, and Ajax submits a request to refresh the page.

Source: Internet
Author: User
Tags actionlink

View:

<td>
@if (item. Reviewproject.declarestate = = Declareorreviewstate. In progress &&!item. Issubmit)
{
@Html. ActionLink ("Editing", "edit", new {id = Item). Applicationprojectid}) <text> |</text>
@Html. ActionLink ("Remove", "delete", new {id = Item). Applicationprojectid}) <text> |</text>
@* @Html. ActionLink ("Commit", "submit", new {id = Item). Applicationprojectid}) *@
<a href= "Javascript:submitapp (' @item. Applicationprojectid ') "class=" Submitapp "> Submit </a><text> |</text>
}

Javascript:

@section Scripts {
<script>
function Submitapp (AppID)
{
var choice = confirm ("Do you confirm the submission?" will not be changed after submission.) ");//Confirmation box.
if (choice = = True) {
$.post ("/applicationproject/submit/", {id:appid})
. Success (function (data) {
Alert ("Submit success");
Location.href = "/applicationproject/indexforapplicator"; Jump page//or use window.location.href= "index/";

});
}

}

</script>

}

Methods of the Controller

Submit a Declaration item
[HttpPost]
public void Submit (string id)
{
var appproject = db. Applicationprojects.find (ID);
Appproject.issubmit = true;
Db. SaveChanges ();
Return redirecttoaction ("Indexforapplicator");

}

Confirm the use of the box. A confirmation box pops up, and Ajax submits a request to refresh the page.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.