Ask a Question related to ASP.NET General, Design and Development.
-
noname #1
web form user control best practices?
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
noname Guest
-
value get form web page to user control
hi I have one webpage and In that web page I have one user control I have one dropdown control in webfrom. I want selected value of that droupdown... -
Best Practices: Porting ASCX control to compiled Custom Control?
Hi There! What is the best way to port the ASCX control to complied Custom Control (i.e. DLL)? Please share some pointers. Also, can many ASCX... -
Q: User Control & Form Authentication
Hi, I have a page (home.aspx) and an user control (footer.ascx) which located in different websites. The website that user control located... -
User control resets the form elements
Hi Furkan, Are you dinamically creating and adding controls to the control tree? It looks like some of your controls are not there when postback... -
Web user control content doesn't resize in web form table
Hi Paul: The only suggestion I could give is to wrap the table with a <div> tag, and set the width of that <div> to be 100%. ASP.NET controls...



Reply With Quote

