Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

Thursday, March 29, 2012

newbie: HTML controls vs Web controls

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/Hi,
R.A.M. wrote:
> Hello,
> I am learning .NET 2.0. And I have a question: when to use web-controls an
d
> when to use HTML controls?
> /RAM/
The System.Web.UI.HtmlControls namespace is for HTML controls, in the
sense that they are declared on the page using standard HTML tags, for
example "input", "select", "textarea", etc...
The System.Web.UI.WebControls namespace is for ASP.NET controls, which
are declared on the page with an "asp:" prefix, for example "asp:Checkbox".
The different is that in the first case, they're client-side controls.
You use them on the server in order to set attributes, scripts, etc...
which are executed on the client. In the second case, however, (and
while you can also influence the way they will be rendered on the
client), the events you wire them to are executed on the server
(involving a postback).
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
It depends on what you are more comfortable with. If you come from Windows
application background, you will find that web controls are more friendly
and they are a less dramatic change from your previous experience.. If you
come from html background you will like html controls. As you master your
asp.net skills, you will likely lean more towards html controls as they give
you better control over client-side functionality.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"R.A.M." <r_ahimsa_m@.poczta.onet.pl> wrote in message
news:ejgq05$8h1$1@.news.onet.pl...
> Hello,
> I am learning .NET 2.0. And I have a question: when to use web-controls
> and when to use HTML controls?
> /RAM/
>

newbie: HTML controls vs Web controls

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/Hi,

R.A.M. wrote:

Quote:

Originally Posted by

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls and
when to use HTML controls?
/RAM/


The System.Web.UI.HtmlControls namespace is for HTML controls, in the
sense that they are declared on the page using standard HTML tags, for
example "input", "select", "textarea", etc...

The System.Web.UI.WebControls namespace is for ASP.NET controls, which
are declared on the page with an "asp:" prefix, for example "asp:Checkbox".

The different is that in the first case, they're client-side controls.
You use them on the server in order to set attributes, scripts, etc...
which are executed on the client. In the second case, however, (and
while you can also influence the way they will be rendered on the
client), the events you wire them to are executed on the server
(involving a postback).

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
It depends on what you are more comfortable with. If you come from Windows
application background, you will find that web controls are more friendly
and they are a less dramatic change from your previous experience.. If you
come from html background you will like html controls. As you master your
asp.net skills, you will likely lean more towards html controls as they give
you better control over client-side functionality.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"R.A.M." <r_ahimsa_m@.poczta.onet.plwrote in message
news:ejgq05$8h1$1@.news.onet.pl...

Quote:

Originally Posted by

Hello,
I am learning .NET 2.0. And I have a question: when to use web-controls
and when to use HTML controls?
/RAM/
>

Saturday, March 24, 2012

Newbie: storing static data within a custom control

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 <option> tags?
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,
KathrynHard-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:

> 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 <option> tags?
> 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

Newbie: storing static data within a custom control

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,
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