Tony's Blogger
2019年3月12日 星期二
C# MVC 清空文字方塊
使用 ModelState.clear() 把 model 中的資料清空,同步地也會清空 view 上文字方塊的資料。
public
ActionResult
Index
()
{
return
View
();
}
[
HttpPost
]
public
ActionResult
Index
(
FormCollection
collection
)
{
// 這就會把 Model 中的資料清空
ModelState
.
Clear
();
return
View
();
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
remove last word from SQL query
SET @columnSql = SUBSTRING ( @columnSql , 1 , LEN ( @columnSql ) - 1 )
Visual Studio 無法叫用中斷點
解決 Visual Studio 無法叫用中斷點 原始程式碼與原始版本不同 1.把 Visual Studio 關掉 2.把專案中的 bin obj 資料夾刪掉 3.重開 Visual Studio 並建置 完成
javascript 特殊符號轉換
function htmlEscape ( str ) { return str . replace ( /&/ g , '&' ) . replace ( /"/ g , ...
Kendo Grid 修改刪除按鈕與功能
columns: [ { field: "FirstName", title: "First Name" }, { field: "LastName", title: ...
沒有留言:
張貼留言