Results 1 to 13 of 13

Thread: Breakpoint question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Breakpoint question

    Hello

    I put a breakpoint on this line in forgot.aspx.vb:

    Dim HtmlMessage As AlternateView = AlternateView.CreateAlternateViewFromString("<img html code here...

    and then pressed 'Step Into'. This is what I get in forgot.aspx [dynamic]:

    Code:
    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['forgotPwd'];
    if (!theForm) {
        theForm = document.forgotPwd;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
    <
    This is highlighted in yellow:

    Code:
    if (!theForm) {
    with a yellow pointing arrow in the left margin and that final left-pointing arrow at the very bottom has a red squiggle under it.

    Name:  screenshot.jpg
Views: 864
Size:  25.4 KB

    In the Call Stack, I get:

    > Global code [forgot.aspx] Line 108 Script
    What does this mean, please - my SMTP code is sending out duplicate emails and I am trying to determine why.

    Thanks

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Breakpoint question

    A red squiggly would normally indicate an error, often a syntax error.
    I'm not familiar with web programming or scripting so I can't say what the issue is, but I have to wonder what does the single "<" on that line do? Why is it there? The red squiggly would tend to make me think it shouldn't be there.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: Breakpoint question

    Thanks, passel

    I suspected that myself.

    I will have to try to identify the JS file where that redundant '<' comes from.

    Thanks again

    Steve

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Breakpoint question

    It comes from that file... there's an opening script tag, but no closing tag... it looks like the closing tag may have gotten partially deleted, leaving the < at the end.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Breakpoint question

    As VS Javascript code decompilation is still lousy, I would suggest running this on the browser you are using (preferably firefox with firebug) and see what the real problem is.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: Breakpoint question

    Hello

    Thanks for your replies - and patience!

    The error in the screenshot is in Visual Studio (2013), but when I go to the page online (http://www.dimadayoub.net/forgot.aspx and press F12, this is what I see (IE11 - sorry, not familiar with Firefox):

    Code:
    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['forgotPwd'];
    if (!theForm) {
        theForm = document.forgotPwd;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
    </script>
    Here is a screenshot from F12:

    Name:  no_divorced_arrow.jpg
Views: 317
Size:  45.5 KB

    That is, VS throws an error due to the left arrow, an arrow that F12 cannot even see. The JavaScript is not mine or part of any JavaScript file I am using in Solution Explorer - I assume Visual Studio has created it itself. But how to correct the error - the arrow?

    Thanks again.

  7. #7
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Breakpoint question

    If the code is created by the application then not sure what you can do rather than see it with firefox and or chrome. I explorer tends to stop at errors without any true explanation and I think that is what it is doing now.
    It breaks at some point , you get an arrow but there is still more code that is missing.
    Would be better if you look at your code again not what asp is creating.
    Currently ,p ersonally I can't debug anything since I don't know what to debug, since there is no clear error, since you need to view the exceptions thrown in either firefox or chrome.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  8. #8
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Breakpoint question

    Anyhow, here is what I get as errors from your provided link.
    Please take in consideration that I heavily block scripts at Home so some or it may be due to my script blocking...

    Name:  Untitled.jpg
Views: 323
Size:  12.3 KB
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: Breakpoint question

    Hello Sapator

    Thanks again for your reply.

    I will have a look now through Chrome and post back.

    Steve

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: Breakpoint question

    Hello

    This is a screenshot from FF:

    Code:
    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['forgotPwd'];
    if (!theForm) {
        theForm = document.forgotPwd;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
    </script>
    
    <script src="/WebResource.axd?d=GDYUWWW_6p_pGimK6Q8oInsy_oWDOJl9DguRiiC74PugYCf6lckcf4AqXEs3xnBHg1gd4BknjHnnUh0X3Ygp0TF3We
    Thanks again
    Attached Images Attached Images   
    Last edited by SteveHi; Apr 21st, 2017 at 04:31 PM.

  11. #11
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Breakpoint question

    Hi.
    That is what JavaScript is writing back.
    I guess we started at the wrong foot here.
    Is there actually any JavaScript that you are writing YOURSELF on the page?All I can see is some asp custom validators.
    Are you writing any script or you just explore the error?
    If the latest then the problem probably, maybe, is something else. If you are writing JavaScript can you show us the part of the code?
    Are you referencing "modernizr" . I get a" modernizr-latest.js not found". Are you referencing it correctly?

    So you are saying "SMTP code is sending out duplicate emails " . I'm aware that SMTP is created on the server side , or at least on a web service call but on the server side nevertheless.
    So maybe we need to focus on that issue? If you use Chrome or firefox, I'm under the impression that non critical JavaScript error will be bypassed( not 100% sure for that) , is the code working on those browsers and you get duplicate emails? If so then i think the problem is something on the server side code and the Javascript issue is just a "bonus" you get, probably because you are not referencing "modernizr" correctly.
    Could be wrong but from what I see this is my assumption.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: Breakpoint question

    Hello Sapator

    Thanks again for your reply.

    No, I have not written any JavaScript - I don't know JavaScript at all.

    Yes, I am trying to understand why the SMTP is sending out duplicate emails. Whether I browse to the forgot.aspx page
    online at http://www.dimadayoub.net/forgot.aspx

    in IE11 or in Chrome the result is the same: duplicate emails are sent.

    Modernizer is no longer supported: http://modernizr.com/downloads/modernizr-latest.js

    and so I have commented it out. Maybe I should remove it altogether from my code if it is showing up as an error?

    After I see this error

    Name:  VS_forum1.jpg
Views: 264
Size:  42.5 KB

    I select Debug | Continue and get this:

    Name:  VS_forum2.jpg
Views: 263
Size:  69.2 KB

    and, bizzarely, when I then click anywhere in the main window pane in Visual Studio, the red underlines disappear until I begin the debug process again when they reappear.

    Thank again for your time.

    Steve

  13. #13
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,597

    Re: Breakpoint question

    So OK.
    A fast reply here as I'm in the office with tons of work.
    Remove the Modernizer. See if that solves the JS error.
    Then if it does not solve it, for a moment, remove the custom validators, see if solves it.
    Also check the initial errors I have shown on post #8, see if you are missing an import or you try to import any unsupported files.

    If everything fails and you get the JS error, just forget it for a moment and try to solve the SMTP error. The site will probably work right now, as I see it, with the javascript errors.
    So either start a new topic, showing your smtp issue, that would a server side code or post it here.

    P.S. I may not be able to reply as I'm working right now.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Posting Permissions

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



Click Here to Expand Forum to Full Width