Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a peculiar problem where I am getting mixed results in web browsers.

Internet Explorer in Vista and XP always works fine.

On Vista (Home Premium at least) Firefox and other browsers also work fine.

On XP Firefox, Opera, Sea Monkey and Google Chrome does not do what I expect.

The emphasis here is that ALL browsers work in Vista so I am pretty sure that my code is not the problem (I think).

I have a set of buttons on a page with the onclick pointing to javascript code, when the buttons are clicked an object var is concatenated with the value of the button pressed.

A submit button, an asp server control has an onclick and an onclientclick, this is wired to a callback function which sets a session object with the accumulated values of the buttons that were pressed a return var is set to load a response page with parameters indicating success or failure of the first operation.

On success, the response page sets the InnerHTML of a div with the values of the selected buttons. This is where the problem is, in vista all is ok, on XP the values are not present indicating that either the parameters have not been read or the session object does not contain values.

If I step through the code in Firefox on XP everything works fine, it is only when I upload to the web site that things go pear shaped.

Can some one tell me what is going on.
Posted

Have you checked the security settings on the different machines ? You can also use firebug to step through the js code when it runs from the server.
 
Share this answer
 
In your situation, I would first compare the HTML between the two outputs ( locan and on the server ) to make sure they are OK. Then I'd add a ton of message box code to try to tell me exactly what is not working as expected. I'd investigate the version of .NET running on the server, compared to local, and consider any other differences between the two that may exist. Sounds like a PITA tho.
 
Share this answer
 
PITA == pain in the a$$. It's hard, without seeing any code, to try to comment further, but if it works fine locally, but not off the server, the two possibilities are, that the security settings for a remote server are the issue, or the server itself is the issue. If the code returned is identical, then I'd go with security settings still.
 
Share this answer
 
Thanks for your quick reply.

I have check security and compared XP with with vista I cannot see any problem with security settings and yes I have checked with firebug but have not come up with anything conclusive. everything works on the test server but not when it is uploaded.
 
Share this answer
 
Again thanks for quick reply,

I am not familiar with the term "Sounds like a PITA tho."

Target framework is 2.0 but I am not sure what is on the hosting server will check this out.

I did include message boxes wherever I could get a result but nothing.

Could the .NET version be the problem!

regards.
 
Share this answer
 
Have check .NET vesrion, host is setup for 2/3 and 3.5 IIS is version 7.

regards
 
Share this answer
 
This is the code that is having the problem, not much to go wrong really.

//If response is OK, set the innerhtml of the div.

//the response page is called so I am assuming that the call back is also being executed since it cannot get here if is not.

     if(nvc.Get("response") == "OK")
   {
       //either this is not being executed.
       setInnerHtml();
   }

 public void setInnerHtml()
       {
   //buttons
   session KeyPad = (session)Session["keyPad"];
   //the selected buttons
   // ** or this has no values.
   session SelectedButtons = (session)Session["selecteditems"];

   string InnerHtml = "";

   string p = "<;div style=\"text-align:center; width: 15px; height: 15px; float: left; margin-right: 5px; background-color: [Color];\">;</div>";
       string s=p;
       for(int i=0; i < SelectedButtons.selecteditems.Count; ++)
           {
           s = p;
           for(int j = 0; j< KeyPad.keypad.ColorCollection.Count; j++)
               {
               if(KeyPad.keypad.ColorCollection[j].selected == SelectedButtons.selecteditems[i].selected)
                   s = s.Replace("[Color]", KeyPad.keypad.ColorCollection[j].selected.ToKnownColor().ToString());
               }
           InnerHtml += s;
           }
       selColors.InnerHtml = InnerHtml;



       }


And yes it is a PITA...

regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900