[HttpPost]
public ActionResult Index(DebuggerIndexFormHolder holder)
{
var result = _debuggerIndexFormProcessor.Process(holder.DebuggerIndexForm, ModelState);
if (result.IsSuccess)
{
return RedirectToAction("Item", new { id = result.SessionId });
}
}
[HttpGet]
public ActionResult Item(string id, string inputId)
{
var model = _debuggerSessionViewModelBuilder.Build(id, inputId);
return View(model); // it opens the required view in same window
}
HTML代碼我想用MVC
<button id="submit" type="submit" data-loading-text="Loading..." class="btn btn-primary">Debug it!</button>
的ActionResult「指數」之稱,並且輪流調用的ActionResult「項目」,通過會話ID爲動作結果「Item」,它在會話ID基礎上填充模型,然後調用View,我需要使用相同的會話ID在不同的窗口中打開此視圖。 任何人都可以幫我嗎? 謝謝
當驗證失敗時,它也打開新窗口,這不是預期的行爲,任何人都可以幫助嗎?我正在使用formtarget =「_ blank」 – Dev
我想要這個提交按鈕始終處於啓用狀態,我已經使用下面的 $(document).ready(function(){ \t \t \t $('#submit')。on ( 'error.field.bv',函數(例如,數據){ \t \t \t \t e.preventDefault(); \t \t \t \t如果(data.bv.getSubmitButton()){ \t \t \t \t \t數據.bv.disableSubmitButtons(false); \t \t \t \t} \t \t \t}) \t \t \t \t。對( 'success.field.bv',函數(例如,數據){ \t \t \t \t \t e.preventDefault(); \t \t \t \t \t如果(data.bv.getSubmitButton()){ \t \t \t \t \t \t data.bv.disableSubmitButtons(假); \t \t \t \t \t} \t \t \t \t}); \t \t}); – Dev
使用上面的代碼,它被啓用,並再次被禁用。在cshtml頁面中沒有表單標籤。提前感謝! – Dev