RE: Gridview textbox has data check without postback.. javascript?
I have a gridview with a textbox. I can set the textbox to
autopostback and check for a value in a prerender event to decide if I
should make a button on the grid row visible. However, the problem
with autopostback on a textbox is the postback occurrs when you select
another control or click away ( I guess). This is very awkward when
the control selected is dropdown as the page/selected control apears
to flicker and show and then retract the dropdownlist.
What's the best way to attack this? .. I want a button on my gridview
row to be visible when both a textbox and dropdown on the control
have data selected/entered. problem is, I don't want to turn
autopostback on the textbox since it behalves awkwardly when the next
control selected is a dropdown and that cause a postback before I can
even select a value.
Thanks in advance for any help or information.
Angel - 13 Feb 2008 22:54 GMT
Suggest you post a code sample

Signature
aaa
> RE: Gridview textbox has data check without postback.. javascript?
>
[quoted text clipped - 14 lines]
>
> Thanks in advance for any help or information.
bruce barker - 14 Feb 2008 04:29 GMT
you should always render the button but hide with style="display:none",
then in javascript via a onchange handler, check the value, then set the
style to block.
if you are going to do .net development, you should learn the w3c dom
and javascript. posting back to tweek the UI is very bad coding. some
will suggest using an update panel, but that is way overkill for this
and would be slow over the internet.
-- bruce (sqlwork.com)
> RE: Gridview textbox has data check without postback.. javascript?
>
[quoted text clipped - 14 lines]
>
> Thanks in advance for any help or information.