Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > web form user control best practices?

Reply
Thread Tools

web form user control best practices?

 
 
noname
Guest
Posts: n/a
 
      06-26-2003
i have a few user controls that need a "visible" property. one example is
an error box. the error box's visible property would only be set in the
event of an error, of course. i've come up with two methods to do this,
neither of which seem optimal.

1. user control consists of simply a single <asp:label>. all output - be
it table tags, row tags, etc. - is set to the label's text property when the
user control's visible property is true.

2. user control consists of a few <asp> control - labels, text boxes,
etc. - and when the user control's visible property is set or reset i do the
same for each <asp> control.

(1) has the funny feeling of how one programs in regular old ASP. (2)
doesn't allow other non ASP.NET content because normal <html> tags can't be
turned on and off like <asp> controls.

i'd like to do something like the following and still have the entire
thing's visibility togglable:

<%@ control codebehind="foo.cs" ... %>
<table>
<tr>
<td><asp:label id="lblFoo" runat="server">Foo</asp:label></td>
<td><asp:textbox id="txtFoo" runat="server"></asp:textbox></td>
</tr>
</table>

now, to be able to turn the <table> output on or off too ...

thanks for any help!
noname


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 1 10-04-2005 12:29 PM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net Web Controls 0 10-03-2005 10:23 AM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 0 10-03-2005 10:23 AM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM



Advertisments