A
abcd
Let me know if you know this.
I have Aspx page with below control structure.
AjaxTabContainer
- ReceiptPanel
? Literal
? ReportViewer
- EmailPanel
o UserControl
? TextBox1
? TextBox1
? Button
I want to access the ReportViewer control from Button action.
I tried
var rptVw = (ReportViewer)
Parent.Parent.Parent.Controls[0].Controls[1].Controls[1];
This works but looks ugly. Also I dont want to search the control by its ID.
[I dont want hardcoding so that it can be used multiple places]
I am blind at this moment. Do you see efficient way to reach to
ReportViewer, from the button action.
I have Aspx page with below control structure.
AjaxTabContainer
- ReceiptPanel
? Literal
? ReportViewer
- EmailPanel
o UserControl
? TextBox1
? TextBox1
? Button
I want to access the ReportViewer control from Button action.
I tried
var rptVw = (ReportViewer)
Parent.Parent.Parent.Controls[0].Controls[1].Controls[1];
This works but looks ugly. Also I dont want to search the control by its ID.
[I dont want hardcoding so that it can be used multiple places]
I am blind at this moment. Do you see efficient way to reach to
ReportViewer, from the button action.