G
Guest
Hi
I've got a form with a TextBox and an invisible button, and I've got it set
so that pressing enter causes the button to click. WOrks fine, the forms
submits on enter and my datalist refreshes (tis a search textbox/list).
I'm trying to implement AJAX style behaviour (its an intranet) - so as you
type in the box, it refreshes the results list.
So far I've tried OnKeyPress="TextChange" - where TextChange is a public C#
method in Codebehind, I've tried
OnKeyPress="javascript:document.form1.submit()" and ive just tried
OnKeyPress="__doPostBack(blah...)" - all with the same effect.
The form submits itself, as you;d expect, but then when it returns,
everything is reset to when the page was first loaded (eg. txtbox is set to
"Type here" etc). It's like it's reloading the page from scratch, and
ignoring ViewState. ViewState is switched on thouh.
I don't know whats wrong - any suggestions on how to do this!?
I should point out that the textbox and hidden imagebutton are in a user
control - dunno if that makes any diff?
Cheers
Dan
I've got a form with a TextBox and an invisible button, and I've got it set
so that pressing enter causes the button to click. WOrks fine, the forms
submits on enter and my datalist refreshes (tis a search textbox/list).
I'm trying to implement AJAX style behaviour (its an intranet) - so as you
type in the box, it refreshes the results list.
So far I've tried OnKeyPress="TextChange" - where TextChange is a public C#
method in Codebehind, I've tried
OnKeyPress="javascript:document.form1.submit()" and ive just tried
OnKeyPress="__doPostBack(blah...)" - all with the same effect.
The form submits itself, as you;d expect, but then when it returns,
everything is reset to when the page was first loaded (eg. txtbox is set to
"Type here" etc). It's like it's reloading the page from scratch, and
ignoring ViewState. ViewState is switched on thouh.
I don't know whats wrong - any suggestions on how to do this!?
I should point out that the textbox and hidden imagebutton are in a user
control - dunno if that makes any diff?
Cheers
Dan