Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded User Controls - Good Idea as HTML Wrapper

Status
Not open for further replies.

BG12424

Programmer
Jun 4, 2002
717
US
I would like to provide an HTML wrapper user control for my DataGrid because I have some custom formatting that I would like to perform. I was thinking about have a general user control to be the HTML wrapper around another user control, which contains my datagrid that might change based on particular values within the user control.

The reason I am doing this is because I am unable to suppress the HTML wrapper if no results exist; therefore not displaying the user control containing the datagrid.

Is there another solution that is better? Thanks


regards,
Brian
 
I'm not 100% sure i follow... but if you just want so supress some portion of your page if there are no results in the data grid, can't you just stick that portion into a panel control and set the visible property accordingly?

Once upon a time i got into usercontrols inside of usercontrols and it wasn't pretty.
 
I hear what you are saying and yes, it hard to write such a request too. Thanks for trying, I really appreciate it. Here is my logic if it makes any more sense.

1.aspx file has --> 2.user control wrapper which --> 3.embeds user control that generates datagrid which --> 4.calls routine from class file returning sqldatareader

I get stuck trying to implement #2. And how does #1 determine if there is data in order to load the usercontrol in #3?

I tried messing around with the datalist and repeater control within only one usercontrol but unable to suppress the header/footer templates by setting the visible property on them.

Basically, I am just trying to separate presentation from logic, so I don't want to write out html from within one of my code-behind or class files. Any thoughts on this? Thanks





regards,
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top