Ask a Question related to ASP.NET General, Design and Development.
-
Domien Holthof #1
AutoPostBack question.
Hi,
I'm having a straight HTML <input type="text"
onkeypress="CheckKey();"> within a <form runat="server">.
When I press ENTER when in the textbox, the client-side
CheckKey() function is executed but still the form or page
seems to do an AutoPostBack to the server.
Any ideas on how to avoid this postback?
Thanx a lot in advance,
Domien
Domien Holthof Guest
-
TabIndex and AutoPostBack
I have a long form that includes several fields which require AutoPostBack=True. I want the user to be able to tab through the fields in sequence... -
no AutoPostBack for Grid?
I have a grid with a select button. I went to turn off AutoPostBack and there is no such attribute. Is there any way to make a grid behave as... -
Problem with Autopostback
I have a relatively long page with a number of webcontrols with "autopostback" set to true. The contents/items/datasources of the subsequent... -
AutoPostBack
I have another question. On my page there is a datagrid and in a templatecolumn it contains a dropdownlist. The AutoPostBack property of the... -
Can NOt AutoPostBack for two DDL
Can NOt AutoPostBack for two DDL Posted: 07-03-2003 01:35 AM I have a usercontrol a.ascx ,put two DDL on the ascx. in an aspx's codebehind... -
Ravikanth[MVP] #2
AutoPostBack question.
Hi Domien
Just use return; statement in your javascript function.
HTH
Ravikanth
runat="server">.>-----Original Message-----
>Hi,
>
>I'm having a straight HTML <input type="text"
>onkeypress="CheckKey();"> within a <formpage>When I press ENTER when in the textbox, the client-side
>CheckKey() function is executed but still the form or>seems to do an AutoPostBack to the server.
>
>Any ideas on how to avoid this postback?
>Thanx a lot in advance,
>
>Domien
>.
>Ravikanth[MVP] Guest
-
Marina #3
Re: AutoPostBack question.
The statement has to say "return false", and your onclick event has to say
"return CheckKey();".
Also, this is just a plain submit to the server, this is not related to the
autopostback that can happen with a dropdown.
"Domien Holthof" <domien.holthof@alcopa2wheels.com> wrote in message
news:095601c34c65$9a70d6c0$a501280a@phx.gbl...> Hi Ravikanth,
>
> I didn't realy understood what you meant, so I tried to
> make the function look like this:
>
> function CheckKey()
> {
> ... // My code to check the key and do stuff...
> return;
> }
>
> That didn't solve it. Next I tried this :
> function CheckKey()
> {
> ... // My code to check the key and do stuff...
> return false;
> }
>
> That didn't do the trick either. But could anyone tell
> WHAT is causing the postback and how to prevent it?
>
> Thanx,
> Domien
>> >-----Original Message-----
> >Hi Domien
> >
> >Just use return; statement in your javascript function.
> >
> >HTH
> >Ravikanth
> >
> >> >runat="server">.> >>-----Original Message-----
> >>Hi,
> >>
> >>I'm having a straight HTML <input type="text"
> >>onkeypress="CheckKey();"> within a <form> >page> >>When I press ENTER when in the textbox, the client-side
> >>CheckKey() function is executed but still the form or> >.> >>seems to do an AutoPostBack to the server.
> >>
> >>Any ideas on how to avoid this postback?
> >>Thanx a lot in advance,
> >>
> >>Domien
> >>.
> >>
> >
Marina Guest



Reply With Quote

