You can use this method to add a new error to an existing validation summary control from your code-behind page. Don't forget to use the proper ValidationGroup that your validation summary is using.
protected void AddErrorToValidationSummary(string errorMessage)
CustomValidator custVal = new CustomValidator();
custVal.IsValid = false;
custVal.ErrorMessage = errorMessage;
custVal.EnableClientScript = false;
custVal.Display = ValidatorDisplay.None;
custVal.ValidationGroup = "MyValidationGroup";
I always seem to be looking this up. So here it is:
ALTER TABLE TableName
ADD CONSTRAINT ConstraintName
UNIQUE NONCLUSTERED (ColumnName)
var allowEnterKey = false;
window.document.onkeydown = CheckEnter;
var keyID = (window.event) ? event.keyCode : e.keyCode;
if (!allowEnterKey && keyID == 13)
Then my search box (or whatever) can be wrapped in a Panel control like so:
<asp:Panel ID="pnlSearch" runat="server" DefaultButton="btnSearch">
<asp:TextBox ID="txtSearch" runat="server" Columns="60"
onfocus="allowEnterKey=true" onblur="allowEnterKey=false" />
<asp:Button ID="btnSearch" runat="server" Text="Search"
onclick="btnSearch_Click" onfocus="allowEnterKey=true" onblur="allowEnterKey=false" />
Notice the DefaultButton property set on the Panel as well as the onfocus and oblur properties of the TextBox.
Today I was adding the new HTML Editor control (newly added to the AJAX Control Toolkit) to an Intranet page. Whenever I would mouse click into the HTML Editor it would continue to expand. This would only occur in IE 8. When using Firefox or IE 8 in compatibility mode it wouldn't happen. I tracked it down to the following declaration in my CSS file:
I removed this declaration and instead used the cellpadding attribute for the table. This solved the issue. Very strange.