Introduction:
I am using Updatepanel [Ajax] in my site. According to my client specification, in which panel or div cursor focus on, when he/her press enter, the corresponding panel button click event will fire and request goes to server and gives response.
i am using
Here my problem starts…
Problem:
1. The DefaultButton property of the Panel/Form won’t work in Mozilla when you hit enter key, when all these panels are reside in UpdatePanel control.
2. When any one press Enter button, it should check for validation if any input controls are there in that panel.
Solution:
After a long research i wrote small java script function to solve the problem.
OnClientClick=”setDefaultButton(this.name);
Java script function:
function setDefaultButton(name)if you have any issues with my code, please let me know.
{
Page_ClientValidate();
if(document.all)
{}
else
{
if(!Page_IsValid)
__doPostBack(name,"");
}
}
No comments:
Post a Comment