Changes in vb code seem to be ignored

Discussion in 'Visual Studio' started by belna, Jan 8, 2014.

  1. My site is http://www.arithmequick.com . It has opened fine for years like this:
    [1] It opens with index.aspx
    [2] index.aspx opens AQ.swf
    [3] AQ.swf loads my games by calling http://www.arithmequick.com/TestLoadVars.aspx passing the parameter "LoadSTopicsForGames"
    [4] On TestLoadVars.aspx open, its code-behind, TestLoadVars.aspx.vb, goes to the Case "LoadSTopicsForGames", loads the games and the program runs fine
    Now, In TestLoadVars.aspx.vb, I added the Case "LoadChallengeLevels" and I added this to the opening:
    [5] AQ.swf tries to load my games by calling http://www.arithmequick.com/TestLoadVars.aspx passing the parameter " LoadChallengeLevels "
    In response, I get Error #2101.
    Please help!
     
  2. martino

    martino DiscountASP.NET Staff

    When I visited the page: http://www.arithmequick.com/TestLoadVars.aspx I got the following error message on this page: "System.NullReferenceException: Object reference not set to an instance of an object."

    I found this web page article that talks about this error message here: http://codebetter.com/raymondlewall...tance-of-an-object-3-common-causes-in-vb-net/

    It means that your page is calling on a reference that is null. I would suggest you check your tables in your database that your page is calling on and make sure their is no null referenced. Also, double check the connection strings in your web application and make sure its only connecting to a single SQL database. If you see any connection string trying to connect to a SQL Express database please make sure you comment those out and only use the SQL connection string to our database.
     
    mjp likes this.
  3. Thanks Martino for your response. When you open http://www.arithmequick.com/TestLoadVars.aspx , it expects parameters which are missing here. For example, to load my games (which works in the program), you would open http://www.arithmequick.com/TestLoadVars.aspx?ActionType=LoadSTopicsForGames&CategoryIndex=0 and it will return a lengthy string starting with gameStr=... So, in the code=behind, TestLoadVars.aspx.vb, there is a Select Case ActionType and in this case, it goes to Case "LoadSTopicsForGames" in which it uses the parameter CategoryIndex and calls a Stored Procedure to build the string gameStr and send it back with
    Response.Write("gameStr=" + gameStr).
    After , seeing the length gameStr produced by http://www.arithmequick.com/TestLoadVars.aspx?ActionType=LoadSTopicsForGames&CategoryIndex=0, I used VisualStudio 2010 to insert the two lines
    Response.Write("gameStr=Howdy")
    Exit Sub
    at the very top of the code in Case "LoadSTopicsForGames" and I re-built the website.
    Then, I ran http://www.arithmequick.com/TestLoadVars.aspx?ActionType=LoadSTopicsForGames&CategoryIndex=0 again to get the same length gameStr as before instead of gameStr=Howdy.
    This makes me think that an old version of TestLoadVars.aspx.vb in cache is being called instead of the new one.
     
  4. mjp

    mjp

    That could be what's happening, but the cache would be local (or on a CDN if you use one)...there's no cache on the server. When you upload a file change the server will use the new file for any subsequent requests.

    You might want to try recycling the application pool after you change files as well.
     
    martino likes this.
  5. Thanks for your good suggestion, mjp, but that did not help.

    I'm on a standalone computer and, each time I test this, I first Delete: Temporary Internet Files and Website Files & Cookies and Website Data.

    Trying the simplest example, I used VisualStudio 2010 to added this case to my code-behind www.arithmequick.com/TestLoadVars.aspx.vb :

    Select Case ActionType
    Case "Chuck"
    Response.Write("chuckStr=Howdy")
    Exit Sub

    But, when I run http://www.arithmequick.com/TestLoadVars.aspx?ActionType=Chuck (after deleting my local cache), I get a blank screen instead of chuckStr=Howdy.
     
  6. Apparently, the file TestLoadVars.aspx.vb was corrupted because I created a new web form LoadVars.aspx and copied the code from TestLoadVars.aspx.vb to LoadVars.aspx.vb and I changed the call to TestLoadVars.aspx to a call to LoadVars.aspx and all works fine now. Thanks to martino and mjp for their attempt to help!
     
    martino likes this.
  7. martino

    martino DiscountASP.NET Staff

    Ahh! Sounds Confusing but I'm glad you resolved your issue! Thank you for posting what worked for you :)
     

Share This Page