I am an experienced Web programmer, now learning ASP.net 2.0. I am
currently teaching myself how to create a custom control. I have the
control designed and it renders beautifully. The only problem I have
is that I would like to store some static data in this control. The
control is an address control and it has a dropdown for the state.
Since state names are static, it seems to me to be best practice to
store the names within the control. So, question #1 is: Is that truly
best practice?
If it is best practice, question #2a: Is there any advantage to storing
the data as an array and having the control loop as it renders versus
hardcoding all the renders for the <optiontags?
If it is NOT best practice, question #2b: What is the recommended
alternative?
As always, any ideas, resources, references, war stories, or good clean
jokes would be greatly appreciated.
Thanks,
KathrynWilliam,
Thanks, that makes sense.
Have a good week,
Kathryn
William Sullivan wrote:
Quote:
Originally Posted by
Hard-coding the states into the HTML is a perfectly acceptible way to do it.
Its only 100 characters, anyhow (not including tags).
>
Best practices would dictate that this is bad, because it is not localizable
(globalizable? Ironic that you make something globally accessible by making
it localizable). But if your web app isn't designed from the start to be
localizable, who cares? It takes a tremendous amount of effort to
internationalize your application; but if that isn't in the scope of the app,
then stick it in the HTML and be happy you don't have to learn how they do
mailing addresses in Zimbabwe.
>
"kbutterly" wrote:
>
Quote:
Originally Posted by
Good morning all,
I am an experienced Web programmer, now learning ASP.net 2.0. I am
currently teaching myself how to create a custom control. I have the
control designed and it renders beautifully. The only problem I have
is that I would like to store some static data in this control. The
control is an address control and it has a dropdown for the state.
Since state names are static, it seems to me to be best practice to
store the names within the control. So, question #1 is: Is that truly
best practice?
If it is best practice, question #2a: Is there any advantage to storing
the data as an array and having the control loop as it renders versus
hardcoding all the renders for the <optiontags?
If it is NOT best practice, question #2b: What is the recommended
alternative?
As always, any ideas, resources, references, war stories, or good clean
jokes would be greatly appreciated.
Thanks,
Kathryn
0 comments:
Post a Comment