Loading

从连接触发删除事件

前台代码:
Code

后台代码:
    protected void Delete_OnClick( object sender, CommandEventArgs ce )
    
{
        
        
try
        
{
            rt.Delete( 
int.Parse (ce.CommandArgument .ToString ()) );
            
if ( int.Parse( Session["GVState"].ToString( ) ) < 0 )
            
{
                Session[
"GridView"= rt.select( );
                GridView1.DataSource 
= rt.select( );
                GridView1.DataBind( );
            }

            
else
            
{
                Session[
"GridView"= rt.select( txtKey.Text, cbIsInPos.Checked, FilePath );
                GridView1.DataSource 
= rt.select( txtKey.Text, cbIsInPos.Checked, FilePath );
                GridView1.DataBind( );
            }

        }

        
catch ( Exception ex )
        
{
            txtErrorMessage.Text 
= ex.Message;
        }

    }
posted @ 2008-01-19 17:09  today4king  阅读(199)  评论(0编辑  收藏  举报