AJAX를 통해 연속적으로 게시하려고 시도하지만 두 번째 게시하지 않습니다. 페이지가 다시로드되지 않기 때문입니다. 게시물은 테이블의 다른 셀에서 가져 와서 다른 ActionResults로 이동하고 모든 것은 모든 것을 렌더링하는 MVC 섹션 내에 있습니다.연속 AJAX 게시물 C# MVC
MVC에서 일하고 있습니다.이 게시물을 볼 수 있습니다.
첫 번째 게시물 :
<tr>
@using (Ajax.BeginForm("ChangeContactInformation", null, new AjaxOptions { UpdateTargetId = "profileTable" }, FormMethod.Post))
{
<td>
@Html.TextBoxFor(x => x.CurrentUser.ContactInformation, new { Name = "ContactInformation" })<button type="submit">Spara</button>
</td>
}
</tr>
둘째 게시물 : 여기
<tr>
@using (Ajax.BeginForm("ChangeTemporaryMessage", null, new AjaxOptions { UpdateTargetId = "profileTable" }, FormMethod.Post))
{
<td>
@Html.TextBoxFor(x => x.CurrentUser.ContactInformation, new { Name = "TemporaryMessage" })<button type="submit">Spara</button>
</td>
}
</tr>
는 컨트롤러의 : 그래서 첫 번째는 완벽하게 작동
[HttpPost]
public ActionResult ChangeTemporaryMessage(string TemporaryMessage)
{
var model = (ProfileBlockViewModel)Session["model"];
ConnectionHelper.ChangeTemporaryMessage(TemporaryMessage, model.CurrentUser.UserID);
return RedirectToAction("Index", model);
}
[HttpPost]
public ActionResult ChangeContactInformation(string ContactInformation)
{
var model = (ProfileBlockViewModel)Session["model"];
ConnectionHelper.ChangeContactInformation(ContactInformation, model.CurrentUser.UserID);
return RedirectToAction("Index", model);
}
하지만 문제는 해당 게시물 후 데이터가 업데이트되고 두 번째 게시글에서 게시하거나 첫 번째 게시글에서 다시 게시 할 수 없습니다. 정교한 게시물 허용, 정확히 내가 원하는 것입니다.
어쨌든 이것을 얻을 수 있습니까?
미리 감사드립니다.
deSex
이 소스를 보는 시도
deSex. using 문이 일반 HTML 양식으로 변경된다는 것을 알 수 있습니다. Html을 안다면 테이블 행에 열을 넣어야한다는 것을 알 수 있습니다. – MiniRagnarok
그래, 실제로 좀 분명했다. 나를 상기시켜 줘서 고마워! :) – deSex