A couple of small gems

I came across two little utilities today that have made my life easier (or, at least, the bits of my life spent in front of a JavaScript debugger!).

First, thanks to km0tion for his mozXPath scripts, that make porting IE-only XML code to run under Firefox that much easier.

Secondly, Firefox 1.5’s JS console now reports CSS as well as JS errors. I must be a lousy CSS writer, because my console floods with errors, making the JS ones hard to find. Well, today I found Console2 , a JS console replacement extension that allows filtering on the reported errors, including getting rid of those pesky CSS errors. So thanks to zeniko for taking the time to write that one too!

5 Responses to “A couple of small gems”

  1. Jim Plush Says:

    Might I suggest the FireBug firefox extension which you can use instead of the JS console, it even has support for debugging xmlHTTPRequests. Its invaluable.

    that and venkman debugger are two extensions I cannot live without for ajax development

    Jim

  2. Jim Says:

    Hi,

    I need your help with this and I hope you can tell me what I must do to
    fix this.
    I have AJAXPRO setup and running fine with 3 linked dropdowns
    (countries,states,towns)
    I’m using this in the CreateUserWizard control, in a web user control,
    in a content page from a non-nested masterpage. I created a step called
    userprofile, added a text control Zip code/Postal town with a regex
    validation, added the 3 dropdown controls and it’s working fine getting
    the data with AJAXPRO BUT when I click the finish button or previous
    button it generates the following error:

    Invalid postback or callback argument. Event validation is enabled
    using in configuration or in a page. For security purposes,
    this feature verifies that arguments to postback or callback events
    originate from the server control that originally rendered them. If
    the data is valid and expected, use the
    ClientScriptManager.RegisterForEventValidation method in order to
    register the postback or callback data for validation.
    Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Invalid postback or
    callback argument. Event validation is enabled using in configuration or in a page. For security purposes, this
    feature verifies that arguments to postback or callback events
    originate from the server control that originally rendered them. If
    the data is valid and expected, use the
    ClientScriptManager.RegisterForEventValidation method in order to
    register the postback or callback data for validation.

    Source Error:

    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of
    the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ArgumentException: Invalid postback or callback argument. Event
    validation is enabled using in
    configuration or in a page.
    For security purposes, this feature verifies that arguments to postback
    or callback events originate from the server control that originally
    rendered them. If the data is valid and expected, use the
    ClientScriptManager.RegisterForEventValidation method in order to
    register the postback or callback data for validation.]
    System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId,
    String argument) +367
    System.Web.UI.Control.ValidateEvent(String uniqueID, String
    eventArgument) +83
    System.Web.UI.WebControls.DropDownList.LoadPostData(String
    postDataKey, NameValueCollection postCollection) +89

    System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.L­oadPostData(String
    postDataKey, NameValueCollection postCollection) +36
    System.Web.UI.Page.ProcessPostData(NameValueCollection postData,
    Boolean fBeforeLoad) +479
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +2549

  3. Phil McCarthy Says:

    Seconded, you *need* to install FireBug, and never look back. It does all the Ajax-related stuff you could only previously get if you had the JS console, Web Developer Toolbar, DOM Inspector and Live HTTP Headers open simultaneously.

    Oh, and you can log to it from JS with the printFire() call, and it has a commandline to evaluate JS statements.

    – Phil

  4. Devnarayan Yadav Says:

    Hello sir I want to use js validation on webcontrol of webuserControl of asp.net

    please give me some tips

    THANKS
    Regards
    Dev

  5. dave Says:

    Hi, Dev,

    I’m not an expert with ASP.Net, I’m afraid - I don’t know if I can be much help.

    What sort of control are you trying to validate? Text? Numeric? Date? An entire form? Your question doesn’t give me much information to go on.

    One golden rule that I can offer - if you validate in the JavaScript, then make sure you validate again on the server, for security reasons.

    All the best,

    Dave