2012-04-26 63 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

回答

相关问题