[CLOSED] Help for debugging

  1. #1

    [CLOSED] Help for debugging

    Hi everyone.
    I don't know if it is possible to have a generic thread about debugging, I'm interested in your opinion.

    Sometimes I get strange behaviors and relative waste of time.
    I don't have a specific debugging protocol and
    1. I run the code go step by step into codebehind
    2. I try to look for javascript errors using the browser's debugging console
    3. I try to inspect controls using Chrome Sencha extension



    Now I'm experiencing an issue hard to reproduce because of too much code to put in an example and I don't even know how to ask help.

    Is there a guideline or specific tools?

    ---
    My current issue is about an internal server error and the debugger does not stop inside visual studio.

    I inherited a Grid and I added the SelectionChanged event in this way

    
    #Region " SelectionChanged "
    
        Public Property SelectionChangedParams As New List(Of Parameter)
        Public Event SelectionChanged(sender As Object, row As DataRow, params As Dictionary(Of String, String))
    
        Private Sub AddSelectionChangedHandler()
            With DirectEvents.SelectionChange
                AddHandler .Event, AddressOf SelectionChanged_Event
                .ExtraParams.Add(New Parameter("ExtremeDataRow", "selected.length && selected[0].data", ParameterMode.Raw))
                For Each p As Parameter In SelectionChangedParams
                    .ExtraParams.Add(p)
                Next
            End With
        End Sub
    
        Private Sub SelectionChanged_Event(sender As Object, e As DirectEventArgs)
            Dim row = GetDataRow(e.ExtraParams("ExtremeDataRow"))
            Dim params As New Dictionary(Of String, String)
            For Each ep As Parameter In e.ExtraParams
                params.Add(ep.Name, ep.Value)
            Next
            If row IsNot Nothing Then
                RaiseEvent SelectionChanged(Me, row, params)
            Else
                RaiseEvent SelectionChanged(Me, Nothing, params)
            End If
        End Sub
    
    #End Region
    In this page I don't handle this event, and if I remove this handler in the inherited control I don't get the error.

    [HttpException (0x80004005): Multiple controls with the same ID 'LocationLookupStore' were found. FindControl requires that controls have unique IDs]
    System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +248
    System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +324
    System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +347
    System.Web.UI.Page.FindControl(String id) +38
    System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +249
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1508


    I have just one LocationLookupStore and I'm sure about it because the line in which I add this one runs just one time.

    I think it is almost impossible to get help in this particolar issue.

    Thanks a lot.
    Last edited by fabricio.murta; Jun 09, 2017 at 7:36 PM. Reason: inquiry fullfilled
  2. #2
    Hello @bbros!

    Maybe the code just runs once, but if it runs once in every code behind call, for example, you could be getting the component drawn more than once in client side. So, say, the second time the client (user web browser) makes a code behind call, it will get the same component twice. In the next call, the client could be then submitting its current state with two components in the request payload, thus triggering the error in code behind.

    Understanding ASP.NET pages' life cycle may be very helpful for these scenarios. I'm not sure how deep is your knowledge on this subject, but if shallow, giving this a try should be helpful. A good starting point would be at MSDN: ASP.NET Page Life Cycle Overview.

    Well, I'm afraid this is as far as we can help you in this matter, without being able to reproduce the issue at our side. If you find a way to reproduce this in a simplified code sample then chances are you'll find the fix by yourself. But if not, don't hesitate in sharing with us and we'll lend a hand.

    If you didn't already, please read thru this forum thread about simplified test cases, it should help you either making up a test case or fixing the problem itself: Tips for creating simplified code samples.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    thanks for your reply.

Similar Threads

  1. Replies: 30
    Last Post: Jan 15, 2015, 1:04 PM
  2. [CLOSED] Help debugging various javascript errors
    By jmcantrell in forum 1.x Premium Help
    Replies: 1
    Last Post: Jun 23, 2010, 1:31 PM
  3. [CLOSED] FormLayout Error while debugging
    By tansu in forum 1.x Premium Help
    Replies: 10
    Last Post: Jun 18, 2010, 8:56 PM
  4. Replies: 0
    Last Post: Dec 27, 2009, 2:47 PM
  5. is javascript debugging possible with coolite
    By joydeepsen in forum 1.x Help
    Replies: 1
    Last Post: Jun 12, 2009, 12:16 PM

Posting Permissions