Thursday, March 29, 2012

Performance Q..

In one of the search window (zip code search) I am using ASP Text box to get
the search text. Is it required to use the text box here, I can use html
input text box and can pass this value for search at the server side when
user clicks the search button.

IS it a good design approach to avoid server side text boxes when compared
to HTML input boxes?

NelsonIt's all a matter of functionality. If all you need is an HTML input form
object, and you don't need it to retain its value across PostBacks,
certainly, a Server Control is not necessary.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
Hi Nelson,
I guess you should use the TextBox control. Because, as I know, the normal
requirement for a Search window is to persist the search query after the
page post backs and gets the results. So, if you use html INPUT, you would
have to use another hidden variable to achieve this, with asp.net TextBox
control you would have the ViewState, which does this automatically if you
keep it enabled. If you do not bother about preserviing the search criteria,
go with html INPUT control with runat server

"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
After the search results (using ZIP Code) I am displaying city, state etc
corresponds to the zip code using a text box control. Is there anyway I can
avoid text box here?

Thanks for your reply.

Nelson

"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> It's all a matter of functionality. If all you need is an HTML input form
> object, and you don't need it to retain its value across PostBacks,
> certainly, a Server Control is not necessary.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > In one of the search window (zip code search) I am using ASP Text box to
> get
> > the search text. Is it required to use the text box here, I can use html
> > input text box and can pass this value for search at the server side
when
> > user clicks the search button.
> > IS it a good design approach to avoid server side text boxes when
compared
> > to HTML input boxes?
> > Nelson
1. By making Run at server can I access the search text from the server side
code. Is it correct?
2. In terms of performance does it matter between HTML INPUT control with
runat server attribute and ASP Server side text box.
Thanks for your suggestions.
Nelson.

"Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> Hi Nelson,
> I guess you should use the TextBox control. Because, as I know, the
normal
> requirement for a Search window is to persist the search query after the
> page post backs and gets the results. So, if you use html INPUT, you would
> have to use another hidden variable to achieve this, with asp.net TextBox
> control you would have the ViewState, which does this automatically if you
> keep it enabled. If you do not bother about preserviing the search
criteria,
> go with html INPUT control with runat server
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > In one of the search window (zip code search) I am using ASP Text box to
> get
> > the search text. Is it required to use the text box here, I can use html
> > input text box and can pass this value for search at the server side
when
> > user clicks the search button.
> > IS it a good design approach to avoid server side text boxes when
compared
> > to HTML input boxes?
> > Nelson
I never did performance tests. But, if you set "EnableViewState" to false,
asp.net TextBox is very much same as html INPUT with runat server. Yes by
making runat = server, you could access the text in the server side. Since
this is the only textbox control on your page, you shouldnt be too worried
about performance I guess

"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:O2UURsOyEHA.2196@.TK2MSFTNGP14.phx.gbl...
> 1. By making Run at server can I access the search text from the server
side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> > Hi Nelson,
> > I guess you should use the TextBox control. Because, as I know, the
> normal
> > requirement for a Search window is to persist the search query after the
> > page post backs and gets the results. So, if you use html INPUT, you
would
> > have to use another hidden variable to achieve this, with asp.net
TextBox
> > control you would have the ViewState, which does this automatically if
you
> > keep it enabled. If you do not bother about preserviing the search
> criteria,
> > go with html INPUT control with runat server
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box
to
> > get
> > > the search text. Is it required to use the text box here, I can use
html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> >
The only performance hit I see is when the asp.net engine converts this
server control into the HTML output for a normal html textbox. Otherwise,
user the textbox control. Nobody will know the difference. The page has to
be compiled either way so its only going to take this hit the first time

"Nelson" wrote:

> 1. By making Run at server can I access the search text from the server side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> > Hi Nelson,
> > I guess you should use the TextBox control. Because, as I know, the
> normal
> > requirement for a Search window is to persist the search query after the
> > page post backs and gets the results. So, if you use html INPUT, you would
> > have to use another hidden variable to achieve this, with asp.net TextBox
> > control you would have the ViewState, which does this automatically if you
> > keep it enabled. If you do not bother about preserviing the search
> criteria,
> > go with html INPUT control with runat server
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box to
> > get
> > > the search text. Is it required to use the text box here, I can use html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> > >
Hi Nelson,

It all depends on what you want the user to do with the data. If you simply
want to display it, a form input object is not necessary; you can simply
write it out to the page. If, on the other hand, you want the user to be
able to edit it, change, it, etc., you would need a form field. And again,
if you want the values in a form field to survive PostBacks, you need to use
a Server Control. Adding "runat=server" to a Control, and declaring it in
the CodeBehind class, effectively creates a Server Control (an HTMLInputText
Control). You can then manipulate and work with the Control in the
CodeBehind class on the server, and it will retain its value across
PostBacks.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:uhgKBmOyEHA.924@.TK2MSFTNGP10.phx.gbl...
> After the search results (using ZIP Code) I am displaying city, state etc
> corresponds to the zip code using a text box control. Is there anyway I
can
> avoid text box here?
> Thanks for your reply.
> Nelson
>
> "Kevin Spencer" <kspencer@.takempis.com> wrote in message
> news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> > It's all a matter of functionality. If all you need is an HTML input
form
> > object, and you don't need it to retain its value across PostBacks,
> > certainly, a Server Control is not necessary.
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Neither a follower
> > nor a lender be.
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box
to
> > get
> > > the search text. Is it required to use the text box here, I can use
html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> >

0 comments:

Post a Comment