Problem to submit an ASP.NET form by the ENTER KEY
-
Hello, Into my asp.net application, i use a masterpage and many content pages. On my masterpage there is 3 asp.net imagebutton controls. in order to display a content page i click on one of this control which use Response.Redirect function. the problem i have is when i use a content page by typing for example informations like Name,email, password, i.e, then if i try to hit enter key to validate my values i am surprise to see that it's the code behind the fisrt image button on my master page wich is run. I have only one button on my content page and i don't understand why the EnterKey don't run the click envent os thif button? Thanks for any help
-
Hello, Into my asp.net application, i use a masterpage and many content pages. On my masterpage there is 3 asp.net imagebutton controls. in order to display a content page i click on one of this control which use Response.Redirect function. the problem i have is when i use a content page by typing for example informations like Name,email, password, i.e, then if i try to hit enter key to validate my values i am surprise to see that it's the code behind the fisrt image button on my master page wich is run. I have only one button on my content page and i don't understand why the EnterKey don't run the click envent os thif button? Thanks for any help
-
try using panels, put your fields inside a panel and set the DefaultButton for that panel
.....your input fields and the button here.....
No matter how long he who laughs last laughs, he who laughs first has a head start!
Hi, Thank's for your reply. Using panel work fine but i met a piece of problem. I have three Button controls on my aspx page whose one is defined as DefaultButton into my panel properties. In some cases this defaultButton is set to Visible=false and enable=false. Because the two others Button are not declared Default in the panel the same problem when i hit Enter Key occurs. Have you any others good suggestions for me? Thank's in advance
-
try using panels, put your fields inside a panel and set the DefaultButton for that panel
.....your input fields and the button here.....
No matter how long he who laughs last laughs, he who laughs first has a head start!
what is the use for panel. i need an explanation for panel... in asp.net
-
Hi, Thank's for your reply. Using panel work fine but i met a piece of problem. I have three Button controls on my aspx page whose one is defined as DefaultButton into my panel properties. In some cases this defaultButton is set to Visible=false and enable=false. Because the two others Button are not declared Default in the panel the same problem when i hit Enter Key occurs. Have you any others good suggestions for me? Thank's in advance
I assume that you set the button visibility from the code behind on some sort of condition, so when you set the visibility for the button, change the default button for the panel as well.
if(someCondition)
{
mainButton.Visible = false;
pnlDetails.DefaultButton = "secondButton";
...
...
}
else
{
mainButton.Visible = true;
pnlDetails.DefaultButton = "mainButton";
...
...
}Hope this helps
No matter how long he who laughs last laughs, he who laughs first has a head start!
-
what is the use for panel. i need an explanation for panel... in asp.net
-
I assume that you set the button visibility from the code behind on some sort of condition, so when you set the visibility for the button, change the default button for the panel as well.
if(someCondition)
{
mainButton.Visible = false;
pnlDetails.DefaultButton = "secondButton";
...
...
}
else
{
mainButton.Visible = true;
pnlDetails.DefaultButton = "mainButton";
...
...
}Hope this helps
No matter how long he who laughs last laughs, he who laughs first has a head start!
Thanks Jacques, Great, great, great! It was so simple. Merci beaucoup!!!
-
Thanks Jacques, Great, great, great! It was so simple. Merci beaucoup!!!
-
Hello, Into my asp.net application, i use a masterpage and many content pages. On my masterpage there is 3 asp.net imagebutton controls. in order to display a content page i click on one of this control which use Response.Redirect function. the problem i have is when i use a content page by typing for example informations like Name,email, password, i.e, then if i try to hit enter key to validate my values i am surprise to see that it's the code behind the fisrt image button on my master page wich is run. I have only one button on my content page and i don't understand why the EnterKey don't run the click envent os thif button? Thanks for any help
-
it's my pleasure, glad I could help
No matter how long he who laughs last laughs, he who laughs first has a head start!
The panel control has the viewstate property and div doesnt A Panel control requires more processing to generate HTML, while a
requires less.