Thursday, March 22, 2012
HTML Controls Vs Web Controls.
Web Controls.
Any preferences'
Cheers,
AdamHTML controls a lightweight controls with a nostalgic interface.
Web Controls are more powerful, and therefore a bit slower.
Here are more details on the differences:
http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Adam Knight" <adam@.pertrain.com.au> wrote in message
news:%239F4RtAuFHA.204@.TK2MSFTNGP10.phx.gbl...
> Just out of interest, what is everbody's thought on using HTML Controls Vs
> Web Controls.
> Any preferences'
> Cheers,
> Adam
>
I never use a Web Control with an HTML equivilant unless absolutely
necessary.
DataGrids and Repeaters are fine, but using <asp:button> instead of
<input type=submit> just strikes me as silly, an can lead to
sloppiness. I've actually had to dress down a junior developer after
finding the following code in an application:
<asp:linkbutton id="myLink" onclick="myLink_Click" text="home"
runat=server></asp:linkbutton>
... and on the server...
protected void myLink_Click(object sender, EventArgs e)
{
Response.Redirect("/home.aspx");
}
Anybody think they could come up with an HTML equivilant to the above?
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
I understand perfectly. No need to do a PostBack when client-side JavaScript
can easily do the job. I've seen it happen entirely too many times. But if
he's a junior developer, why would you need the HTML and JavaScript to do
this? Well, anyway:
<input type="button" value="Home" onclick="document.location='/home.aspx'">
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Jason Kester" <jasonkester@.gmail.com> wrote in message
news:1126636135.317659.47190@.g47g2000cwa.googlegroups.com...
>I never use a Web Control with an HTML equivilant unless absolutely
> necessary.
> DataGrids and Repeaters are fine, but using <asp:button> instead of
> <input type=submit> just strikes me as silly, an can lead to
> sloppiness. I've actually had to dress down a junior developer after
> finding the following code in an application:
>
> <asp:linkbutton id="myLink" onclick="myLink_Click" text="home"
> runat=server></asp:linkbutton>
> ... and on the server...
> protected void myLink_Click(object sender, EventArgs e)
> {
> Response.Redirect("/home.aspx");
> }
>
> Anybody think they could come up with an HTML equivilant to the above?
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
>
I was thinking more along the lines of:
<a href="http://links.10026.com/?link=/home.aspx">Home</a>
That's what he was trying to accomplish with that LinkButton!
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Well, I presumed that a button was wanted. Of course, a hyperlink would be
simpler. But why would he (incorrectly) use a Button Control rather than
(incorrectly) a Hyperlink Control?
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Jason Kester" <jasonkester@.gmail.com> wrote in message
news:1126661657.442216.127510@.g43g2000cwa.googlegroups.com...
>I was thinking more along the lines of:
> <a href="http://links.10026.com/?link=/home.aspx">Home</a>
> That's what he was trying to accomplish with that LinkButton!
>
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
>
Junior Developer. Never overestimate the capabilities of these guys.
They'll surprise you every time!
It was an ASP:LinkButton control that he used. Which renders as an
anchor tag with a bunch of javascript to force a postback. He was
looking for a control that looked like a link, and would take the user
to a different page when clicked.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
>Junior Developer. Never overestimate the capabilities of these guys.
>They'll surprise you every time!
>It was an ASP:LinkButton control that he used. Which renders as an
>anchor tag with a bunch of javascript to force a postback. He was
>looking for a control that looked like a link, and would take the user
>to a different page when clicked.
Which kind of leads you to wonder what's the most complicated and
convoluted way you do such a thing? I mean his way was fairly
complicated for such a simple task, but he is only a junior developer.
Surely the great experienced minds of this newsgroup can come up with an
even more convoluted way of achieving the same thing?
I throw down the gauntlet. Anyone care to take the challenge?
Alan Silver
(anything added below this line is nothing to do with me)
HTML Controls Vs Web Controls.
Web Controls.
Any preferences??
Cheers,
AdamHTML controls a lightweight controls with a nostalgic interface.
Web Controls are more powerful, and therefore a bit slower.
Here are more details on the differences:
http://SteveOrr.net/faq/3in1.aspx#HTMLvsWeb
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Adam Knight" <adam@.pertrain.com.au> wrote in message
news:%239F4RtAuFHA.204@.TK2MSFTNGP10.phx.gbl...
> Just out of interest, what is everbody's thought on using HTML Controls Vs
> Web Controls.
> Any preferences??
> Cheers,
> Adam
I never use a Web Control with an HTML equivilant unless absolutely
necessary.
DataGrids and Repeaters are fine, but using <asp:button> instead of
<input type=submit> just strikes me as silly, an can lead to
sloppiness. I've actually had to dress down a junior developer after
finding the following code in an application:
<asp:linkbutton id="myLink" onclick="myLink_Click" text="home"
runat=server></asp:linkbutton
... and on the server...
protected void myLink_Click(object sender, EventArgs e)
{
Response.Redirect("/home.aspx");
}
Anybody think they could come up with an HTML equivilant to the above?
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
I understand perfectly. No need to do a PostBack when client-side JavaScript
can easily do the job. I've seen it happen entirely too many times. But if
he's a junior developer, why would you need the HTML and JavaScript to do
this? Well, anyway:
<input type="button" value="Home" onclick="document.location='/home.aspx'"
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Jason Kester" <jasonkester@.gmail.com> wrote in message
news:1126636135.317659.47190@.g47g2000cwa.googlegro ups.com...
>I never use a Web Control with an HTML equivilant unless absolutely
> necessary.
> DataGrids and Repeaters are fine, but using <asp:button> instead of
> <input type=submit> just strikes me as silly, an can lead to
> sloppiness. I've actually had to dress down a junior developer after
> finding the following code in an application:
>
> <asp:linkbutton id="myLink" onclick="myLink_Click" text="home"
> runat=server></asp:linkbutton>
> ... and on the server...
> protected void myLink_Click(object sender, EventArgs e)
> {
> Response.Redirect("/home.aspx");
> }
>
> Anybody think they could come up with an HTML equivilant to the above?
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
I was thinking more along the lines of:
<a href="http://links.10026.com/?link=/home.aspx">Home</a
That's what he was trying to accomplish with that LinkButton!
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Well, I presumed that a button was wanted. Of course, a hyperlink would be
simpler. But why would he (incorrectly) use a Button Control rather than
(incorrectly) a Hyperlink Control?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Jason Kester" <jasonkester@.gmail.com> wrote in message
news:1126661657.442216.127510@.g43g2000cwa.googlegr oups.com...
>I was thinking more along the lines of:
> <a href="http://links.10026.com/?link=/home.aspx">Home</a>
> That's what he was trying to accomplish with that LinkButton!
>
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
Junior Developer. Never overestimate the capabilities of these guys.
They'll surprise you every time!
It was an ASP:LinkButton control that he used. Which renders as an
anchor tag with a bunch of javascript to force a postback. He was
looking for a control that looked like a link, and would take the user
to a different page when clicked.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
>Junior Developer. Never overestimate the capabilities of these guys.
>They'll surprise you every time!
>It was an ASP:LinkButton control that he used. Which renders as an
>anchor tag with a bunch of javascript to force a postback. He was
>looking for a control that looked like a link, and would take the user
>to a different page when clicked.
Which kind of leads you to wonder what's the most complicated and
convoluted way you do such a thing? I mean his way was fairly
complicated for such a simple task, but he is only a junior developer.
Surely the great experienced minds of this newsgroup can come up with an
even more convoluted way of achieving the same thing?
I throw down the gauntlet. Anyone care to take the challenge?
--
Alan Silver
(anything added below this line is nothing to do with me)