Hi all,
I have an login form where sign in button is an imagebutton. I my case when user enters password and clicks sign in then it will work fine.
but when user enters password and press enter key then page will be refreshed and login will not happen.
Here i need to call imagebuttonclick function on enter press. The form is default.aspx and i am using master form also hence I am not able to get body tag.
How can i do this can any one help me.
Loading

Deepak Bhatia142 reputationPosted Aug 5, 2010, 12:54 AM EDT
Form.DefaultButton = yourbuttonname.UniqueID;
Deepak Bhatia142 reputationPosted Aug 4, 2010, 10:42 PM EDT
Hi Rajath,
In your page load function write this code.
Form1 is the name of the form in which your button is placed
protected void Page_Load(object sender, EventArgs e)
{
this.form1.DefaultButton = yourbuttonname;
}
rajath r30 reputationPosted Aug 4, 2010, 11:52 PM EDT
Now i am getting an error as "'Home' does not contain a definition for 'form1' and no extension method 'form1' accepting a first argument of type 'Home' could be found (are you missing reference".
I my application, i have button on default.aspx and i am using master page, admaster.master in default.aspx.
form1 is page form id in master page.
Thanks in advance
Deepak Bhatia142 reputationPosted Aug 5, 2010, 1:01 AM EDT
If any probs reply I will answer it.