Monday, March 26, 2012
Newbie client side JavaScript debugging issue
I apologise for the potential stupidity of this question in advance.
After doing a lot of server side ASP.NET coding and debugging, I've
had to do a little bit of client side java script.
My problem is that I've made a mistake somewhere, and all the browser
tells me is "Error on page". I've tried setting break points inside
Visual Studio.NET, but they don't get "fired".
As a result of this, I don't have any idea what mistake/s I have made.
Basically, can someone please give this newbie some advice as to how I
can effectively debug and track down my client side javascript bugs
inside Visual Studio.NET
Thank you very much.
Robert.Does this help you?
http://support.microsoft.com/defaul...kb;en-us;317094
http://msdn.microsoft.com/library/d...application.asp
http://msdn.microsoft.com/library/d...ptdebugging.asp
--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
".NET Developer" <pleasereplytogroups@.hotmail.com> wrote in message
news:66900ea6.0308020327.dd6c318@.posting.google.co m...
> Hello.
> I apologise for the potential stupidity of this question in advance.
> After doing a lot of server side ASP.NET coding and debugging, I've
> had to do a little bit of client side java script.
> My problem is that I've made a mistake somewhere, and all the browser
> tells me is "Error on page". I've tried setting break points inside
> Visual Studio.NET, but they don't get "fired".
> As a result of this, I don't have any idea what mistake/s I have made.
> Basically, can someone please give this newbie some advice as to how I
> can effectively debug and track down my client side javascript bugs
> inside Visual Studio.NET
> Thank you very much.
> Robert.
Many thanks Carsten!
- Robert.
"CT" <carstent@.spammersgowaydotnetservices.biz> wrote in message news:<ueK3zuOWDHA.1480@.tk2msftngp13.phx.gbl>...
> Does this help you?
> http://support.microsoft.com/defaul...kb;en-us;317094
> http://msdn.microsoft.com/library/d...application.asp
> http://msdn.microsoft.com/library/d...ptdebugging.asp
> --
> Carsten Thomsen
> Enterprise Development with Visual Studio .NET, UML, and MSF
> http://www.apress.com/book/bookDisplay.html?bID=105
> ".NET Developer" <pleasereplytogroups@.hotmail.com> wrote in message
> news:66900ea6.0308020327.dd6c318@.posting.google.co m...
> > Hello.
> > I apologise for the potential stupidity of this question in advance.
> > After doing a lot of server side ASP.NET coding and debugging, I've
> > had to do a little bit of client side java script.
> > My problem is that I've made a mistake somewhere, and all the browser
> > tells me is "Error on page". I've tried setting break points inside
> > Visual Studio.NET, but they don't get "fired".
> > As a result of this, I don't have any idea what mistake/s I have made.
> > Basically, can someone please give this newbie some advice as to how I
> > can effectively debug and track down my client side javascript bugs
> > inside Visual Studio.NET
> > Thank you very much.
> > Robert.
Saturday, March 24, 2012
Newbie having problems with a server error
"Object reference not set to an instance of an object."
I understand the error but can't see why it's happening. The line it refers to is:
<%Response.Write(Validate.setColour(errorcode[0]));%
The 'Validate' object is an instance of the following class:
using System;namespace _4Touristweb
{
/// <summary>
/// Summary description for validate.
/// </summary>
public class validate
{
private string outputString;public validate()
{
//
// TODO: Add constructor logic here
//
}public string setColour(bool errorcode)
{
if (errorcode)
//set colour to red
outputString = "<DIV style=\"color:"+"#FF0000"+";\">";
else
//set colour to black
outputString = "<DIV style=\"color:"+"#000000"+";\">";return outputString;
}
}
}
And in the HTML file I have this at the top, which creates the instance of the class.
<%@dotnet.itags.org. Page language="c#" Codebehind="reg2.aspx.cs" AutoEventWireup="false" Inherits="_4Touristweb.WebForm1" %>
<script runat="server" language="C#">
public bool[] errorcode;
public _4Touristweb.validate Validate = new _4Touristweb.validate();
public string businessName;
public string address;
public string district;
public string town;
public string postcode;
public string telephone;
public string fax;
public string county;
public string email;
public string contactName;
public bool terms;
</script
I'm afraid I haven't a clue why the error is coming up.Hi,
In this line <%Response.Write(Validate.setColour(errorcode[0]));%
What is the errorcode[0] value. Seems like there is no value to send to the Validate.setColour() Method.
Thanks for that 'heads up'. I forgot to create an instance of the boolean array in the declarations in the start.
Been a few years since I last did any serious OOP and it's showing.