ps: и ведь не поспоришь
8 часов назад
<script language="javascript" type="text/javascript">
Web.Customization.validatorsStylingApply();
Web.Customization.invalidatedControlStyleName = "invalidatedControl";
Web.Customization.invalidatedSelectControlStyleName = "invalidatedSelectControl";
</script>
<style type="text/css">
.invalidatedControl {
border: 2px solid #DD0000;
}
</style>
<td>
<asp:TextBox ID="txtAdministrativeEmail" runat="server" Text="" Columns="40" MaxLength="40" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvEmail" runat="server"
ControlToValidate="txtAdministrativeEmail"
SetFocusOnError="false"
EnableClientScript="true"
Display="Dynamic"
ErrorMessage="Enter the correct administrative email"
Font-Size="12pt"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="revEmail"
runat="server"
ControlToValidate="txtAdministrativeEmail"
Display="Dynamic"
SetFocusOnError="false"
EnableClientScript="true"
ErrorMessage="Invalid administrative email, please enter correct value..."
ValidationExpression=".*@.*\..*" ></asp:RegularExpressionValidator>
</td>
/* customization of validation controls */
var Web = {};
Web.Customization = function() {
///
///Helper class for the standart asp.net validators styling
///
this.invalidatedControlStyleName = "invalidatedControl";
this.invalidatedSelectControlStyleName = "invalidatedControl";
}
Web.Customization.prototype.validate = function() {
///
///Custom Validation proxy method
///
var hooked_result = false;
if (typeof Page_Validators != 'undefined' &&
Page_Validators != null) {
if (this["fwvalidator"] != null) {
var validator = this["fwvalidator"];
var fwevaluationfunction_object = eval("hooked_validator = " + this["fwevaluationfunction"]);
eval("hooked_result = hooked_validator(validator);")
validator.isvalid = hooked_result;
var object = $get(this["controltovalidate"]);
var controlstyle = "";
if (hooked_result) {
for (var i = 0; i < Page_Validators.length; i++) {
var previousValidator = Page_Validators[i];
if (previousValidator.controltovalidate == this.controltovalidate) {
if (previousValidator.id != this.id) {
hooked_result = previousValidator.isvalid;
}
else if (previousValidator.id == this.id) {
break;
}
}
}
}
if (hooked_result) {
if (this["controlstyle"] != null) {
controlstyle = this["controlstyle"];
object.className = controlstyle;
}
else
object.removeAttribute("className");
if (object.tagName == 'SELECT') {
var parentObj = object.parentElement;
if (parentObj.tagName == 'DIV') {
parentObj.removeAttribute("className");
}
}
}
else {
if (object.tagName == 'SELECT') {
var parentObj = object.parentElement;
if (parentObj.tagName == 'DIV') {
parentObj.className = Web.Customization.invalidatedSelectControlStyleName;
}
}
else {
object.className = Web.Customization.invalidatedControlStyleName;
}
}
}
}
return hooked_result;
};
Web.Customization.prototype.validatorsStylingApply = function() {
///
///Applies the custom styling logic into the all validators on the current page
///
if (typeof Page_Validators != 'undefined' &&
Page_Validators != null) {
var validators = Page_Validators;
for (var i = 0; i < validators.length; i++) {
if (validators[i].attributes["evaluationfunction"] != null) {
if (validators[i].attributes["display"] != null) {
validators[i].attributes.removeNamedItem("display");
}
var displayAttribute = document.createAttribute("display");
displayAttribute.value = "None";
validators[i].attributes.setNamedItem(displayAttribute);
if (validators[i]["fwvalidator"] == null) {
validators[i]["fwvalidator"] = validators[i];
validators[i]["fwevaluationfunction"] = validators[i].attributes["evaluationfunction"].value;
validators[i]["controltovalidate"] = validators[i].attributes["controltovalidate"].value;
var control = $get(validators[i]["controltovalidate"]);
if (control != null &&
control.className != null &&
control.className != '')
validators[i]["controlstyle"] = control.className;
validators[i].attributes["evaluationfunction"].nodeValue = Web.Customization.validate;
}
}
}
}
}
/* global objects initialization */
Web.Customization = new Web.Customization();
Альбом: Blog |
Specified argument was out of the range of valid values.
Parameter name: utcDate
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate]
System.Web.HttpCachePolicy.UtcSetLastModified(DateTime utcDate) +3261043
System.Web.HttpCachePolicy.SetLastModified(DateTime date) +47
System.Web.Handlers.ScriptResourceHandler.PrepareResponseCache(HttpResponse response, Assembly assembly) +194
System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) +1154
System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
<ajaxtoolkit:tabcontainer id="tabContainerCompanyProfile" runat="server" enableviewstate="true" width="100%">
</ajaxtoolkit:tabcontainer>
<table>
<tr>
<td>
<asp:PlaceHolder ID="phTabContainer" runat="server" EnableViewState="true">
</asp:PlaceHolder>
</td>
</tr>
...........................
var availableTabs = (from pd in this.ProfileDescriptors
where pd.CompanyTypes.Contains(this.CompanyType) &&
(pd.EditMode == EditMode.All || pd.EditMode == this.ProfileMode)
select pd).ToList();
if (availableTabs != null &&
availableTabs.Count > 0)
{
AjaxControlToolkit.TabContainer tabContainer = new AjaxControlToolkit.TabContainer();
tabContainer.Width = Unit.Parse("100%");
tabContainer.Enabled = true;
tabContainer.Visible = true;
phTabContainer.Controls.Add(tabContainer);
foreach (ProfileDescriptor profileDescriptor in availableTabs)
{
foreach (TabDescriptor tabDescriptor in profileDescriptor.TabDescriptors)
{
CompanyProfileTabs.CompanyPropertiesTabBase propertiesEditor = (CompanyProfileTabs.CompanyPropertiesTabBase)this.LoadControl(tabDescriptor.TabControlURL);
if (propertiesEditor != null)
{
AjaxControlToolkit.TabPanel tab = new AjaxControlToolkit.TabPanel();
tab.Visible = true;
tab.Width = Unit.Percentage(100);
tab.Enabled = true;
tab.HeaderText = tabDescriptor.HeaderCaption;
propertiesEditor.Visible = true;
tab.Controls.Add(propertiesEditor);
tabContainer.Tabs.Add(tab);
this.Tabs.Add(propertiesEditor);
}
}
}
if (this.Tabs.Count > 0)
{
tabContainer.ActiveTabIndex = 0;
}
}