我正在尝试优化我的ASP.NET 4.0应用程序的视图状态。由于网格视图向视图中添加了大量内容,因此我禁用了viewstateMode。以下是我在禁用视图状态时遇到的问题。
1) On a postback the Gridview is blank.
2) In order to overcome the above problem I tried to bind the data in OnPreRender() then I ran into another problem : The Delete (Rowdelte) and Rowcommand doesn't fir
我正在拦截RowDatabound事件并使用:
DbDataRecord record = (System.Data.Common.DbDataRecord)e.Row.DataItem;
以获得对未绑定数据源列的访问权限。当我将筛选器应用于数据集时,它在页面加载和应用筛选器时运行良好。但是,当我试图在GridView列中引入一个排序时,我得到:
Error: Unable to cast object of type 'System.Data.DataRowView' to type 'System.Data.Common.DbDataRecord'
我想我已
我的ASP.NET GridView出了点问题。
将GridView设置为通过SqlDataSource从存储过程中检索行。Gridview有一个BoundField,它从表单上的ASP.NET文本框中填充存储过程的DateTime参数。
当我在ASP.NET文本框中输入无效的字符,然后单击GridView的任何列对其进行排序时,GridView在其PreRender事件中抛出一个FormatException:"invalid character at position 0“
当GridView中包含无效的DateTime时,我如何拦截或阻止用户对其进行排序?
我已经尝试过表单验证器