English 中文(简体)
分散控制造成奇怪的错误
原标题:Disabling controls causes strange error

我试图对伙伴关系实行不可行的控制。 正在处理中的网络网页。 为此,我通过了以下解决办法:here,砍下了DOM树,分解了所有儿童控制。 这对我试图拆解的屏幕的许多部分来说都是罚款的,但试图拆开一些表层控制会产生以下错误:

Server Error in  /  Application.
--------------------------------------------------------------------------------

Input string was not in a correct format. 
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.FormatException: Input string was not in a correct format.

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: 

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7471479
   System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) +115
   System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info) +192
   System.Double.Parse(String s, IFormatProvider provider) +25
   ComponentArt.Web.UI.NumberInput.set_Value(Nullable`1 value) +81
   ComponentArt.Web.UI.NumberInput.LoadViewState(Object savedState) +255
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +183
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +134
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +221
   System.Web.UI.Page.LoadAllState() +312
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1661




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3618 

这在应用法中都没有,因此我不知道怎么做。 是否有任何人知道如何缩小问题的根源,或我应该开始研究什么地方?

或者,是否有更好的办法消除控制集团?

我也尝试了所建议的方法:here,用于拆卸控制,为此设立了一个小组,并安排了false ,但似乎没有做任何事情。

EDIT:根据要求,这里是旨在取消控制范围的 Java:

    function disableChildElements(objId) 
    { 
        var theObject = document.getElementById(objId); 
        var level = 0; 
        TraverseDOM(theObject, level, disableElement); 
    } 

    function TraverseDOM(obj, lvl, actionFunc) 
    {  
        for (var i=0; i<obj.childNodes.length; i++)
        { 
            var childObj = obj.childNodes[i]; 

            if (childObj.tagName)
            { 
                    actionFunc(childObj); 
            } 

            TraverseDOM(childObj, lvl + 1, actionFunc); 
        } 

    } 

    function disableElement(obj) 
    { 
        obj.disabled = true; 
    } 

    function DisableControls()
    {
        disableChildElements(castVariablesTable.id);
        disableChildElements(oldGradeTable.id);
        oldGradePanel.enabled=false;
    }

<代码>可分解<>功能代码/代码>第一行有效;第二行造成错误。 把第2行改为第3行,以尝试替代方法,是没有意义的。

The cast variables table in the ASP starts like this...

<table id="castVariablesTable" class="normalTable">
    <tr>
        <td>
            <label class="normalText">Number of strands</label>
        </td>
        <td>
            <span class="normalInput">
                <MixedZone:NumberInput runat="server"
                                       ID="niNumberOfStrands" 
                                       MaxLength="1"
                                       Step="1"
                                       Increment="1"
                                       MaxValue="6"
                                       MinValue="1"
                                       NumberType="Number"
                                       DecimalDigits="0">
                </MixedZone:NumberInput>
            </span>

等等。

造成这一问题的表格过于庞大,但含有同样的缺陷;我没有能够控制造成困难的特定控制。

最佳回答

经过更深入的调查,我发现,如果有人企图利用Javascript去打听Component Art:NumberInput控制,而这种控制没有界定价值,则会阻碍这一错误。

为所有<代码>Component Art:NumberInput设定数值,在张贴该页前对其进行控制,以纠正错误。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签