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

List<T>().Add problem C# -

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -