Tuesday, April 20, 2010

Setting Default Button in ASP.Net or The DefaultButton of 'form1' must be the ID of a control of type IButtonControl Error

Default button on a form always gets triggered when we press 'Enter' key on the keyboard. This always reduces the usage of mouse clicks on the button (ex: submit button to submit a form), and it helps the user to save time. ASP.NET 2.0 has exposed a DefaultButton property of the form object that allows you to set the button that will be used as the default when the user presses the Enter key. ASP.NET then handles the client script generation for you.
Page.Form.DefaultButton = btnLogin.UniqueID
For Focus:
Page.Form.DefaultButton = btnLogin.ClientID

Access to XMLHttpRequest at 'from origin has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. .net core angular

Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...