include a clinet javascript funciton something like:
string postbackFunciton = @"function window.onkeypress()
{
if(event.keyCode = 13) " + Page.GetPostBackReference(yourControl , "") +
"}";
"Brian Burgess" <> wrote in message
news:...
> Dont you still have to capture the Enter key click event this way too?
>
> thx
>
> -BB
>
>
> "Eliyahu Goldin" <> wrote in message
> news:...
>> James,
>>
>> Why do you want to simulate a button click? Why can't you just submit the
>> form with javascript submit() and pass parameters, if any, to the server
> via
>> one of the standard ways of passing parameters?
>>
>> Eliyahu
>>
>> "jl39775" <> wrote in message
>> news:35FC22B6-0F96-4507-B2CE-...
>> > I have a web form that I want to fire the Submit web control button
>> > when
> a
>> > user presses the Enter key on the keyboard. I added the following code
> in
>> my
>> > Page_Load method and it works fine in a web form that contains the
> Submit
>> web
>> > control button.
>> >
>> > Page.RegisterHiddenField("__EVENTTARGET", "btnSubmit");
>> >
>> > However, if btnSubmit is in a usercontrol the code above no longer
> works.
>> > The framework changes the id for the button control to _ctl2_btnSubmit.
>> Does
>> > anyone know how I can work around this problem? I could change the code
>> to:
>> >
>> > Page.RegisterHiddenField("__EVENTTARGET", "_ctl2_btnSubmit");
>> >
>> > But, if I decide to add another control later I will have to change it
>> again.
>> >
>> > Also, this should validate the form since the btnSubmit causevalidation
> is
>> > set to true.
>> >
>> > Please help.
>> >
>> > James
>> >
>>
>>
>
>
|