开发者

How do I Catch errors on/before DataBound event

开发者 https://www.devze.com 2023-03-13 00:13 出处:网络
Once the databind is completed, I fire off the databound event. I wanted to catch any error that might have occ开发者_如何学Pythonurred so I dont run the StoredProc \"sp_UpdatePrintQueueToPrinted\".

Once the databind is completed, I fire off the databound event. I wanted to catch any error that might have occ开发者_如何学Pythonurred so I dont run the StoredProc "sp_UpdatePrintQueueToPrinted".

How do I Catch errors on/before DataBound event?

        protected void ListView1_DataBound(object sender, EventArgs e)
    {
        using (GPEntities gpe = new GPEntities())
        {
            gpe.sp_UpdatePrintQueueToPrinted();              
        }
    }


Note that OnDataBound occurs when databinding ends. OnDataBinding occurs as soon as data binding begins.

Are you trying to catch errors relating to the actual databinding itself? If so, wrap your .DataBind() event with a try catch statement. Or is there some other incidental error that you are tracking as a result of the databinding?


You could use OnDataBinding event which kicks in... on data binding =) (before databound event)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号