Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > hitting enter does not submit form but refreshes page?

Reply
Thread Tools

hitting enter does not submit form but refreshes page?

 
 
Abraham Luna
Guest
Posts: n/a
 
      09-02-2005
i am using a master and content page
the regular aspx page not attached to a master page will submit when the
user hits enter

how come a content page will not submit if the user hits enter?


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      09-04-2005
You need to use the <form defaultbutton="IDOfAButton"> or the HtmlForm.DefaultButton
property.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> i am using a master and content page
> the regular aspx page not attached to a master page will submit when
> the
> user hits enter
> how come a content page will not submit if the user hits enter?
>




 
Reply With Quote
 
 
 
 
Abraham Luna
Guest
Posts: n/a
 
      09-06-2005
thank you for your answer brock.

i set the defaultbutton in the page_load event. i get an error:

The DefaultButton of '' must be the ID of a control of type IButtonControl.

i think it's because i use a usercontrol:

<RDK:RDK_BaseButton ID="btnSearch" Text="Search" runat="server"
OnClick="btnSearch_Click" />

what can i do to get .net to recognize that it is really a button?

thank you.

"Brock Allen" <> wrote in message
news: m...
> You need to use the <form defaultbutton="IDOfAButton"> or the
> HtmlForm.DefaultButton property.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> i am using a master and content page
>> the regular aspx page not attached to a master page will submit when
>> the
>> user hits enter
>> how come a content page will not submit if the user hits enter?
>>

>
>
>



 
Reply With Quote
 
Brock Allen
Guest
Posts: n/a
 
      09-06-2005
You need the ID of the Button inside your custom control. The UniqueID property
is the string you want to use when the Button is nested inside other controls.

-Brock
DevelopMentor
http://staff.develop.com/ballen



> thank you for your answer brock.
>
> i set the defaultbutton in the page_load event. i get an error:
>
> The DefaultButton of '' must be the ID of a control of type
> IButtonControl.
>
> i think it's because i use a usercontrol:
>
> <RDK:RDK_BaseButton ID="btnSearch" Text="Search" runat="server"
> OnClick="btnSearch_Click" />
>
> what can i do to get .net to recognize that it is really a button?
>
> thank you.
>
> "Brock Allen" <> wrote in message
> news: m...
>
>> You need to use the <form defaultbutton="IDOfAButton"> or the
>> HtmlForm.DefaultButton property.
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>> i am using a master and content page
>>> the regular aspx page not attached to a master page will submit when
>>> the
>>> user hits enter
>>> how come a content page will not submit if the user hits enter?




 
Reply With Quote
 
Marius
Guest
Posts: n/a
 
      10-26-2005
I have the same scenario where I have a user control that contains an image
button in ASP.Net 2.0 beta 2. Setting the 'DefaultButton' of a panel or form
to the unique ID of the image button within the user control does not work
for me. I keep getting the message about the control has to implement
iButtonControl.

Do you have any further information to assist in this matter?

"Brock Allen" wrote:

> You need the ID of the Button inside your custom control. The UniqueID property
> is the string you want to use when the Button is nested inside other controls.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > thank you for your answer brock.
> >
> > i set the defaultbutton in the page_load event. i get an error:
> >
> > The DefaultButton of '' must be the ID of a control of type
> > IButtonControl.
> >
> > i think it's because i use a usercontrol:
> >
> > <RDK:RDK_BaseButton ID="btnSearch" Text="Search" runat="server"
> > OnClick="btnSearch_Click" />
> >
> > what can i do to get .net to recognize that it is really a button?
> >
> > thank you.
> >
> > "Brock Allen" <> wrote in message
> > news: m...
> >
> >> You need to use the <form defaultbutton="IDOfAButton"> or the
> >> HtmlForm.DefaultButton property.
> >>
> >> -Brock
> >> DevelopMentor
> >> http://staff.develop.com/ballen
> >>> i am using a master and content page
> >>> the regular aspx page not attached to a master page will submit when
> >>> the
> >>> user hits enter
> >>> how come a content page will not submit if the user hits enter?

>
>
>
>

 
Reply With Quote
 
Abraham Andres Luna
Guest
Posts: n/a
 
      10-27-2005
finally got it to work:

if (!IsPostBack)
{
this.Form.DefaultButton = btnSearch.UniqueID;
}



"Marius" <> wrote in message
newsB379ED2-E605-4217-A50F-...
>I have the same scenario where I have a user control that contains an image
> button in ASP.Net 2.0 beta 2. Setting the 'DefaultButton' of a panel or
> form
> to the unique ID of the image button within the user control does not work
> for me. I keep getting the message about the control has to implement
> iButtonControl.
>
> Do you have any further information to assist in this matter?
>
> "Brock Allen" wrote:
>
>> You need the ID of the Button inside your custom control. The UniqueID
>> property
>> is the string you want to use when the Button is nested inside other
>> controls.
>>
>> -Brock
>> DevelopMentor
>> http://staff.develop.com/ballen
>>
>>
>>
>> > thank you for your answer brock.
>> >
>> > i set the defaultbutton in the page_load event. i get an error:
>> >
>> > The DefaultButton of '' must be the ID of a control of type
>> > IButtonControl.
>> >
>> > i think it's because i use a usercontrol:
>> >
>> > <RDK:RDK_BaseButton ID="btnSearch" Text="Search" runat="server"
>> > OnClick="btnSearch_Click" />
>> >
>> > what can i do to get .net to recognize that it is really a button?
>> >
>> > thank you.
>> >
>> > "Brock Allen" <> wrote in message
>> > news: m...
>> >
>> >> You need to use the <form defaultbutton="IDOfAButton"> or the
>> >> HtmlForm.DefaultButton property.
>> >>
>> >> -Brock
>> >> DevelopMentor
>> >> http://staff.develop.com/ballen
>> >>> i am using a master and content page
>> >>> the regular aspx page not attached to a master page will submit when
>> >>> the
>> >>> user hits enter
>> >>> how come a content page will not submit if the user hits enter?

>>
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
STRUTS- <html:submit> does not submit on pressing Enter key Megha Vishwanath Java 2 10-02-2009 12:52 PM
hitting enter or shift+enter in asp.net designer messes up html code? Sunfire ASP .Net 2 11-06-2007 02:44 PM
Difference between hitting enter and clicking submit? 23s ASP .Net 2 02-22-2005 07:13 PM
Form submit - hitting enter does not trigger Submit button ASP General 2 10-25-2004 03:37 PM
STRUTS-<html:submit> -Hitting enter key does not submit the form Megha Vishwanath Javascript 3 07-20-2004 05:45 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57