Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Jordan #1
Need Custom DataReader Loop in User Control: inline vs. code-behind
I'm trying to evaluate the benefits of designing user controls completely
inline vs. using a code-behind file. I already have a user control designed
that does the following:
- gets QString values from URL
- creates DataReader from Sproc
- loops through datareader to display custom output (not using any web
controls here - all custom output)
- during the loop, uses a site-wide class call common functions
I've moved this (more or less) to a code-behind file (I like that I get the
intellisense working when using a .cs file is one reason :). The one thing
I'm curious about is, I had to use a <asp:Label> in my .ascx page in order
to place my datareader content in the right place (if I kept it in the
PageLoad event, it's printed at the top of the page), and I had to use a
StringBuilder.
Which is the best way to do this - does it really matter which way I
implement this?
thanks, j
Jordan Guest
-
custom web controls and conversion to inline code
Our client wanted delivery of the code using inline scripting, but for obvious reasons, we developed the ASP.NET 1.1 app using codebehind. We have... -
Custom control fires event but ignores some code in the code behind file
I do not quite understand the question. I will merely point out that most programming problems happen for a reason. Code works the way it is... -
Custom Control that accepts Inline Code
I created a control which parses its sub objects and wraps the code in an HTML wrapper. For example: <abc:Section ID="Section1" Runat="server"... -
Custom Server Control works on page but not User Control...why?
I'm developing the DevEdit.NET server control (an online HTML editor - www.devedit.com) but there's an extremely bizarre bug. The control runs fine... -
Page Load fired 3 times Web user control is embedded in a custom control
Hi, I have built a custom control that build a table with 3 cells in it. The custom control is designed to add all child controls to cell#2,... -
Scott Mitchell [MVP] #2
Re: Need Custom DataReader Loop in User Control: inline vs. code-behind
I would stick with the code-behind model. One of its benefits, as
you've noted, is IntelliSense. You also can debug easier using the
code-behind technique (setting breakpoints and whatnot). Furthermore,
it fosters better OOP development practices, IMO.
--
Scott Mitchell
[email]mitchell@4guysfromrolla.com[/email]
[url]http://www.4GuysFromRolla.com[/url]
[url]http://www.ASPMessageboard.com[/url]
[url]http://www.ASPFAQs.com[/url]
* When you think ASP, think 4GuysFromRolla.com!
Scott Mitchell [MVP] Guest



Reply With Quote

