Accessing web control from a class — d.o.t.d.

I’ve long ago discovered how to access cheap NFL jerseys control properties and methods from other controls, but never needed to access those properties and methods from a component class.

Say I’m in a control and need to call a method of another control:

C_CntrlClass uc_cntrlid = (C_CntrlClass) Page.FindControl(“uc_cntrlid”);
uc_cntrlid.Method(param);

But what about calling that same Vermont… Method from a Wholesale Miami Dolphins Jerseys class nummer component?  Since the class does not inherit the Web.UI.Page class, it does wholesale nba jerseys not expose the Page object.  wholesale NBA jerseys This is where the IHttpHandler object comes in:

System.Web.UI.Page pg = (System.Web.UI.Page) System.Web.HttpContext.Current.Handler;
C_CntrlClass uc_cntrlid = (C_CntrlClass) pg.FindControl(“uc_cntrlid”);
uc_cntrlid.Method(param);

From 住まいの情報誌県中版4/2 the MS-HELP IHttpHandler documentation:  “HTTP handlers give you a means of Flatrate interacting with the low-level request and response services of the IIS Web server and provide functionality much like ISAPI extensions but with a simpler programming model.”

Here’s the google thread which pointing me in the right direction, with special thanks to Kevin Spencer’s Fotoclub comments.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.