asp.net - How to access an ASP Control in a class file -


i have asp textbox control in .aspx page. have .cs class file , not code behind file. want access textbox control in .cs file. know can pass parameter.but i'm curious know if can through reference way or something.

there scenario.

if have .cs page basepage.cs inherits system.web.ui.page, , if code-behind class inherits basepage, in basepage.cs can gen reference textbox through findcontrol:

textbox txtname = (textbox)this.findcontrol("txtname"); 

but in totally unrelated class it's suspected, way pass parameter.


Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -