2012-04-26 64 views
3

當我試圖從一個頁面導航到webgrid中的其他頁面時,我在帶有分頁的aspx頁面中有一個webgrid。我在aspx頁面丟失了其他控件的數據。基本上,webgrid從一個頁面導航到另一個頁面時,嘗試重新加載整個aspx頁面。當從一個頁面導航到其他webgrid中的aspx頁面時丟失web控件數據

我的問題是如何使這個的WebGrid在我的aspx頁面獨立,而不是重新加載頁面從一個頁面mvoing當其他

預先感謝您

<html> 
<head> 
    <title>Index</title> 
    <style type="text/css"> 
     .webGrid { margin: 4px; border-collapse: collapse; width: 300px; } 
     .header { background-color: #E8E8E8; font-weight: bold; color: #FFF; } 
     .webGrid th, .webGrid td { border: 1px solid #C0C0C0; padding: 5px; } 
     .alt { background-color: #E8E8E8; color: #000; } 
     .person { width: 200px; font-weight:bold;} 
    </style> 
</head> 
<body>    
    @{ 
     var grid = new WebGrid(Model, canPage: true, rowsPerPage: 5); 
     grid.Pager(WebGridPagerModes.NextPrevious); 
     @grid.GetHtml(tableStyle: "webGrid", 
       htmlAttributes: new { id = "DataTable" }, 
       headerStyle: "header", 
       alternatingRowStyle: "alt", 
       columns: grid.Columns(
        grid.Column("Age"), 
        grid.Column("Id"), 
        grid.Column("Name") 
     ));  
    } 
    <input type="text" id="somed" /><select><option value="some">test1</option><option value="some2">test2</option><option value="some3">test3</option></select> 
</body> 
</html> 

在這裏我有一個文本框和一個下拉菜單,所以無論何時我嘗試從一個頁面導航到其他文本框中的值,並且所選下拉值都消失了。

+0

發佈您的代碼,否則它就像在黑暗中拍攝:) – RogueSpear00 2012-04-26 21:34:43

回答

相關問題