2014年7月13日 星期日

[RESOLVED] How can i use UpdatePanel object from class file?


Hi I want to use to below code from Class file.



But There is a error because of class file don't know UpdatePanel object.


How can i solve this problem?



------------------------------------------------------------------------------------------


public void error_handling(Exception ex_obj, System.Web.UI.UpdatePanel updatepanel_obj)


{


...dosomething....


}



Add the referfernce of System.Web.UI.dll.


It should work.



Hi,


You could create a class file and declare the function error_handling within it:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Testing.Class
{
public class UpdatePanelObject
{
public string error_handling( System.Web.UI.UpdatePanel updatepanel_obj)

{
return updatepanel_obj.ID;
//...dosomething....
}

}
}

Then, you could call the function by add the reference:


using namespace;


UpdatePanelObject upo = new UpdatePanelObject();
Response.Write(upo.error_handling(UpdatePanel111));

Regards


沒有留言:

張貼留言