ASP.NET

ASP.NET – A wonderful world of web development.
So many secrets to share. So many tricks to learn.

ASP.NET Combine Validators and Client OnClick Events

2017/05/03
By
Modified: 2017/04/30

  Imagine you need to use control validators, and you also need to attach  additional logic to OnClick event. These two will fight with each other, if you use conventional interface features. If you add OnClick attribute too early (say in GridView_RowEditing event)  it will be overwritten by Validators.  If you add OnClick  attribute very late (say in  Render event) Validators logic will be lost. To make this work, you need to  use a special JavaScript function that combines both procedures. Here is how you do it: You need to change  a few things on the button that causes validation:                     <asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="false"                         OnClientClick="return isValid(this);" ImageUrl="~/Images/Update32x32.png"                         Text="Update"…

Read more »


Failed to Access IIS Metabase

2010/06/28
By
Modified: 2010/11/26

Error Failed to access IIS metabase in ASP.NET page.  Run this command: %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Read more »