|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
create webcontrols in aspx or aspx.csIs it best to always put the webcontrols in the aspx file or is it sometimes
better to create them (new) in the code behind? I see the standard/easiest way is to place them in the aspx, but are there common situations where your output is conditional and it's better to just do it in the aspx.cs file? When you want to have a control shown or hidden depending on a certain
context you can set the Visible property of your controls. Normally what I do is wrap multiple controls within a Panel or PlaceHolder control and set the Visible property as needed. You may also want to look at the MultiView and Wizard controls. Those provide automatic show/hide functionality with added features. Brennan Stehling http://brennan.offwhite.net/blog/ brown wrote: Show quoteHide quote > Is it best to always put the webcontrols in the aspx file or is it sometimes > better to create them (new) in the code behind? I see the standard/easiest > way is to place them in the aspx, but are there common situations where your > output is conditional and it's better to just do it in the aspx.cs file? Thanks for your feedback!
Do you use the Table webcontrol or just put the webcontrols inside unscripted <table><tr><td> tags in the aspx file? I'm thinking try the latter. Just interested in what experienced .net developers approach is to formatting the webcontrols on the page. Show quoteHide quote "Brennan Stehling" <offwh***@gmail.com> wrote in message news:1159034750.246264.83580@m73g2000cwd.googlegroups.com... > When you want to have a control shown or hidden depending on a certain > context you can set the Visible property of your controls. > > Normally what I do is wrap multiple controls within a Panel or > PlaceHolder control and set the Visible property as needed. You may > also want to look at the MultiView and Wizard controls. Those provide > automatic show/hide functionality with added features. > > Brennan Stehling > http://brennan.offwhite.net/blog/ > > brown wrote: > > Is it best to always put the webcontrols in the aspx file or is it sometimes > > better to create them (new) in the code behind? I see the standard/easiest > > way is to place them in the aspx, but are there common situations where your > > output is conditional and it's better to just do it in the aspx.cs file? >
Control events - page life-cycle
ASP.NET 2.0 / GridView / ObjectDataSource / Update / Missing Columns The parameter is not correct from SqlDataAdapter control Controls calling other controls problem - ASP.NET 2.0 ASP code ASP.Net 2.0 DropDownList Selected Not Working... How to keep state of treeview control DropDownList SelectedIndexChanged ASP.NET report viewer chart control dual axis support Gridview - disappearing data when column is hidden |
|||||||||||||||||||||||