simple async post back example

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=

    simple async post back example

    I need to do a simple asych post back to validate that an id is unique. I do
    not want to post back the entire page for this, but i want to make this part
    of the clientside validators.

    1. i already have a custom validator that checks for a correctly formatted
    id and the javascript works w/o problem.

    Any help would be appreciated.
    --
    Share The Knowledge. I need all the help I can get and so do you!
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: simple async post back example

    async postback is incompatiable with validators. validatiors are called to
    cancel a postback, they can not wait around for the async return.

    you could use an update panel, but this is really a full postback and page
    process.

    -- bruce (sqlwork.com)


    "Yankee Imperialist Dog" wrote:
    I need to do a simple asych post back to validate that an id is unique. I do
    not want to post back the entire page for this, but i want to make this part
    of the clientside validators.
    >
    1. i already have a custom validator that checks for a correctly formatted
    id and the javascript works w/o problem.
    >
    Any help would be appreciated.
    --
    Share The Knowledge. I need all the help I can get and so do you!

    Comment

    • =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=

      #3
      RE: simple async post back example

      thanks for replying,
      (I think my description was off.)

      I gues that's the point i want the validator to cancel the post back.
      i have a customvalidator that uses the following script
      <script language="JavaS cript">
      <!--
      function CheckTrepID(sen der, args)
      {
      var TrpID = args.Value;
      var alphs = 'ABCDEFGHIJKLMN OPQRSTUVWXYZ';
      var nums = '0123456789';
      if (TrpID.length != 10)
      {
      args.IsValid = false;
      return;
      }

      for (var i=0;i<3; i++)
      if ( alphs.indexOf(T rpID.charAt(i)) == -1)
      {
      args.IsValid = false;
      return;
      }
      for (var i=3;i<11; i++)
      if ( nums.indexOf(Tr pID.charAt(i)) == -1)
      {
      args.IsValid = false;
      return;
      }
      args.IsValid = true;
      }
      // -->
      </script>

      What i'd like to do is if the script see's that the new Trpid is correctly
      formatted. to call a webservice with that Trpid and have the web service
      return a bool saying if it exists. There has to be a way to do this. I just
      can't find a simple example of how to do this.

      Thanks
      KES
      --
      Share The Knowledge. I need all the help I can get and so do you!


      "bruce barker" wrote:
      async postback is incompatiable with validators. validatiors are called to
      cancel a postback, they can not wait around for the async return.
      >
      you could use an update panel, but this is really a full postback and page
      process.
      >
      -- bruce (sqlwork.com)
      >
      >
      "Yankee Imperialist Dog" wrote:
      >
      I need to do a simple asych post back to validate that an id is unique. I do
      not want to post back the entire page for this, but i want to make this part
      of the clientside validators.

      1. i already have a custom validator that checks for a correctly formatted
      id and the javascript works w/o problem.

      Any help would be appreciated.
      --
      Share The Knowledge. I need all the help I can get and so do you!

      Comment

      • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

        #4
        RE: simple async post back example

        you would need to do a sync webservice call not an async one (or async
        callback). see the ms ajax toolkit or the jquery toolkit.

        -- bruce (sqlwork.com)


        "Yankee Imperialist Dog" wrote:
        thanks for replying,
        (I think my description was off.)
        >
        I gues that's the point i want the validator to cancel the post back.
        i have a customvalidator that uses the following script
        <script language="JavaS cript">
        <!--
        function CheckTrepID(sen der, args)
        {
        var TrpID = args.Value;
        var alphs = 'ABCDEFGHIJKLMN OPQRSTUVWXYZ';
        var nums = '0123456789';
        if (TrpID.length != 10)
        {
        args.IsValid = false;
        return;
        }
        >
        for (var i=0;i<3; i++)
        if ( alphs.indexOf(T rpID.charAt(i)) == -1)
        {
        args.IsValid = false;
        return;
        }
        for (var i=3;i<11; i++)
        if ( nums.indexOf(Tr pID.charAt(i)) == -1)
        {
        args.IsValid = false;
        return;
        }
        args.IsValid = true;
        }
        // -->
        </script>
        >
        What i'd like to do is if the script see's that the new Trpid is correctly
        formatted. to call a webservice with that Trpid and have the web service
        return a bool saying if it exists. There has to be a way to do this. I just
        can't find a simple example of how to do this.
        >
        Thanks
        KES
        --
        Share The Knowledge. I need all the help I can get and so do you!
        >
        >
        "bruce barker" wrote:
        >
        async postback is incompatiable with validators. validatiors are called to
        cancel a postback, they can not wait around for the async return.

        you could use an update panel, but this is really a full postback and page
        process.

        -- bruce (sqlwork.com)


        "Yankee Imperialist Dog" wrote:
        I need to do a simple asych post back to validate that an id is unique. I do
        not want to post back the entire page for this, but i want to make this part
        of the clientside validators.
        >
        1. i already have a custom validator that checks for a correctly formatted
        id and the javascript works w/o problem.
        >
        Any help would be appreciated.
        --
        Share The Knowledge. I need all the help I can get and so do you!

        Comment

        • =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=

          #5
          RE: simple async post back example

          ok, thanks
          --
          Share The Knowledge. I need all the help I can get and so do you!


          "bruce barker" wrote:
          you would need to do a sync webservice call not an async one (or async
          callback). see the ms ajax toolkit or the jquery toolkit.
          >
          -- bruce (sqlwork.com)
          >
          >
          "Yankee Imperialist Dog" wrote:
          >
          thanks for replying,
          (I think my description was off.)

          I gues that's the point i want the validator to cancel the post back.
          i have a customvalidator that uses the following script
          <script language="JavaS cript">
          <!--
          function CheckTrepID(sen der, args)
          {
          var TrpID = args.Value;
          var alphs = 'ABCDEFGHIJKLMN OPQRSTUVWXYZ';
          var nums = '0123456789';
          if (TrpID.length != 10)
          {
          args.IsValid = false;
          return;
          }

          for (var i=0;i<3; i++)
          if ( alphs.indexOf(T rpID.charAt(i)) == -1)
          {
          args.IsValid = false;
          return;
          }
          for (var i=3;i<11; i++)
          if ( nums.indexOf(Tr pID.charAt(i)) == -1)
          {
          args.IsValid = false;
          return;
          }
          args.IsValid = true;
          }
          // -->
          </script>

          What i'd like to do is if the script see's that the new Trpid is correctly
          formatted. to call a webservice with that Trpid and have the web service
          return a bool saying if it exists. There has to be a way to do this. I just
          can't find a simple example of how to do this.

          Thanks
          KES
          --
          Share The Knowledge. I need all the help I can get and so do you!


          "bruce barker" wrote:
          async postback is incompatiable with validators. validatiors are called to
          cancel a postback, they can not wait around for the async return.
          >
          you could use an update panel, but this is really a full postback and page
          process.
          >
          -- bruce (sqlwork.com)
          >
          >
          "Yankee Imperialist Dog" wrote:
          >
          I need to do a simple asych post back to validate that an id is unique. I do
          not want to post back the entire page for this, but i want to make this part
          of the clientside validators.

          1. i already have a custom validator that checks for a correctly formatted
          id and the javascript works w/o problem.

          Any help would be appreciated.
          --
          Share The Knowledge. I need all the help I can get and so do you!

          Comment

          Working...