dcsimg
Results 1 to 7 of 7

Thread: Trying to debug aspx page?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Trying to debug aspx page?

    In trying to debug my aspx page, I've inserted an asp:Label control (it's called "lblDebugger") at the bottom of my page. In my code-behind I created a little procedure that looks like this:

    Code:
        Private Sub Alert(strParm As String)
            lblDebugger.Visible = True
            lblDebugger.ForeColor = Drawing.Color.Red
            lblDebugger.Text = strParm & HTML_BREAK
        End Sub
    So I insert statements here and there in my code to track what's being executed. Problem is, there is nothing in the lblDebugger field. So I can't see what's going on. How do I fix this?

    Thanks,
    Blake

  2. #2
    Hyperactive Member
    Join Date
    Nov 2017
    Posts
    443

    Re: Trying to debug aspx page?

    Is it possible that it is being called multiple times in the same page load and the "final" call passes an empty string?

    Try changing it to something like this:

    Code:
        Private Sub Alert(strParm As String)
            lblDebugger.Visible = True
            lblDebugger.ForeColor = Drawing.Color.Red
            lblDebugger.Text = lblDebugger.Text & strParm & HTML_BREAK
        End Sub

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Re: Trying to debug aspx page?

    Didn't help! Still nothing...
    Blake

  4. #4
    Hyperactive Member
    Join Date
    Nov 2017
    Posts
    443

    Re: Trying to debug aspx page?

    Are you certain the function is being called? Does the label even become visible? Do you have code in any other method that modifies the contents of the label?

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Re: Trying to debug aspx page?

    I have the "Alert" statement at the beginning of each function/subprocedure. It's hitting several of them but not the one's I'm trying to test. If I drop a DropDownList control onto a page...do I need to provide an "OnSelectedIndexChanged" in the tag. I wouldn't think so since it's a server-side control and you do code the SelectedIndexChanged Event in the code-behind. I'm just not sure why that Event isn't being called?
    Blake

  6. #6
    Hyperactive Member
    Join Date
    Nov 2017
    Posts
    443

    Re: Trying to debug aspx page?

    I would do the OnSelectedIndexChanged="Whatever" tag and then make sure your SelectedIndexChanged Method does not have a "Handles" clause and see if that works.

    Just as a side note, I've seen cases where, if you have both the OnSelectedIndexChanged tag defined and the Handles clause in place the method can be called twice, FWIW.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Re: Trying to debug aspx page?

    That worked!!! Functionally it's still not working but at least I know it's being executed now!

    Thanks Option!
    Blake

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width