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 BhatiaPosted Aug 5, 2010, 4:54 AM
Form.DefaultButton = yourbuttonname.UniqueID;
Deepak BhatiaPosted Aug 5, 2010, 5:01 AM
If any probs reply I will answer it.
rajath rPosted Aug 5, 2010, 3:52 AM
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 BhatiaPosted Aug 5, 2010, 2:42 AM
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;
}