// Check that nummber of elements in Enum for the gridcells is the same as actuall number of cells in the gridview.
if (Enum.GetValues(typeof(GridCells)).Length != GridViewData.Columns.Count)
{
throw new Exception("Number of elements in enum GridCells differs from number of cells in GridViewData");
}
måndag 10 september 2012
tisdag 22 maj 2012
Set focus on textbox in panel handled by CollapsiblePanelExtender
</asp:Panel>
<script type="text/javascript" language="javascript">
//
// This part is done because that setting focus in code behind with someting like SetFocusOnControl(TextBoxQualifier)
// for some reson does not work when the text box is placed in a Panel that is handled by a CollapsiblePanelExtender.
//
// Also for some reason it does not work to set focus direct in the pageLoad function (but it does work if a alert statement is done after it)
// thats why the setFocus function is called from setTimeout.
//
var objExtender;
function pageLoad(sender, args) {
objExtender = $find("<% =CollapsiblePanelExtender1.ClientID %>");
objExtender.add_expandComplete(setFocus);
objExtender.add_collapseComplete(setFocus);
setTimeout("setFocus()", 10);
}
function setFocus() {
if (!objExtender.get_Collapsed()) {
$get("<%=TextBoxQualifier.ClientID%>").focus();
}
}
</script>
<script type="text/javascript" language="javascript">
//
// This part is done because that setting focus in code behind with someting like SetFocusOnControl(TextBoxQualifier)
// for some reson does not work when the text box is placed in a Panel that is handled by a CollapsiblePanelExtender.
//
// Also for some reason it does not work to set focus direct in the pageLoad function (but it does work if a alert statement is done after it)
// thats why the setFocus function is called from setTimeout.
//
var objExtender;
function pageLoad(sender, args) {
objExtender = $find("<% =CollapsiblePanelExtender1.ClientID %>");
objExtender.add_expandComplete(setFocus);
objExtender.add_collapseComplete(setFocus);
setTimeout("setFocus()", 10);
}
function setFocus() {
if (!objExtender.get_Collapsed()) {
$get("<%=TextBoxQualifier.ClientID%>").focus();
}
}
</script>
tisdag 17 april 2012
Parser Error Message: The configSource file 'Caching.config' is also used in a parent, this is not allowed.
This error occured in IIS6, Windows 2003.
We solved this by changing the Path for the root-web site to point to another folder than the folder that contains the web-site.
This could be done since nobody uses this root web site.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The configSource file 'Caching.config' is also used in a parent, this is not allowed.
Source Error:
Line 27: Links to other config files.
Line 28: -->
Line 29: <cachingConfiguration configSource="Caching.config"/>
Line 30: <policyInjection configSource="Policy.config"/>
Line 31: <loggingConfiguration configSource="Logging.config"/>
Source File: D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config Line: 29
Show Additional Configuration Errors:
The configSource file 'Policy.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 30)
The configSource file 'Logging.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 31)
The configSource file 'Unity.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 32)
The configSource file 'Exception.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 33)
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634
We solved this by changing the Path for the root-web site to point to another folder than the folder that contains the web-site.
This could be done since nobody uses this root web site.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The configSource file 'Caching.config' is also used in a parent, this is not allowed.
Source Error:
Line 27: Links to other config files.
Line 28: -->
Line 29: <cachingConfiguration configSource="Caching.config"/>
Line 30: <policyInjection configSource="Policy.config"/>
Line 31: <loggingConfiguration configSource="Logging.config"/>
Source File: D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config Line: 29
Show Additional Configuration Errors:
The configSource file 'Policy.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 30)
The configSource file 'Logging.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 31)
The configSource file 'Unity.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 32)
The configSource file 'Exception.config' is also used in a parent, this is not allowed. (D:\Dna\Apps\A4D\a4d-test.vlc.volvo.net\web.config line 33)
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634
måndag 19 mars 2012
Index and length must refer to a location within the string. Parameter name: length
The below error was caused by that Language in the web browser was set to Hungarian (hu-HU).
This problem was resolved by hardcode the culture setting on the MaskedEditExtender object.
In this case it was set to Swedish (SV-SE)
<cc1:MaskedEditExtender ID="maskeditTime" runat="server" TargetControlID="TextBoxTime" MaskType="Time" Mask="99:99" ClearMaskOnLostFocus="false" CultureName="sv-SE"/>
The error print:
Index and length must refer to a location within the string.
Parameter name: length
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: Index and length must refer to a location within the string.
Parameter name: length
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: Index and length must refer to a location within the string.
Parameter name: length]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7495179
System.String.Substring(Int32 startIndex, Int32 length) +11
AjaxControlToolkit.MaskedEditExtender.OnLoad(EventArgs e) +785
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634
This problem was resolved by hardcode the culture setting on the MaskedEditExtender object.
In this case it was set to Swedish (SV-SE)
<cc1:MaskedEditExtender ID="maskeditTime" runat="server" TargetControlID="TextBoxTime" MaskType="Time" Mask="99:99" ClearMaskOnLostFocus="false" CultureName="sv-SE"/>
The error print:
Index and length must refer to a location within the string.
Parameter name: length
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: Index and length must refer to a location within the string.
Parameter name: length
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: Index and length must refer to a location within the string.
Parameter name: length]
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +7495179
System.String.Substring(Int32 startIndex, Int32 length) +11
AjaxControlToolkit.MaskedEditExtender.OnLoad(EventArgs e) +785
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634
måndag 27 februari 2012
Viewstate availability
Maybe it is obvious, but not for me, but:
Viewstate is not accessable from Page_Init, it is accessable first in Page_Load.
Even worse, a ViewState set in Page_Init is available as long the current "instance" is running, but after a post back it is not available anymore.
Viewstate is not accessable from Page_Init, it is accessable first in Page_Load.
Even worse, a ViewState set in Page_Init is available as long the current "instance" is running, but after a post back it is not available anymore.
fredag 24 februari 2012
OWC11 adding an comma sign after some values
For some reason, and just in the Production environment, if you in the Excel object enter a value that is equal to or greater than 2097152, and is equally dividable with 16, gets an comma sign (,) after the value.
That the problems happens with values from 2097152 has something to do with the length of the value when converting it to binary representation,
up to this value the representation is by 21 bits, but from 2097152 it is represented by 22 bits.
I have no idea why this error occurs, and why just in Production environment.
I have uninstalled Excel from our Development environment, and installed the OWC component, so the environment should be identical with Production, but in this environment this problem does not occur.
To get around this problem I only have the following suggestions:
- Add an character, for example 'X' before or after the value
- check for commas when reading data from the Excel object, and remove them.
- Avoid these numbers.
tisdag 7 februari 2012
Uncompress files in Windows XP
To uncompress all files, from current folder and below, type:
compact /u /s /a /q /i *.*
in a CMD-window.
compact /u /s /a /q /i *.*
in a CMD-window.
Prenumerera på:
Inlägg (Atom)