Now, I'm getting "msxml3.dll: Unspecified Error" for the line:
if (xmlHttp.readyState == 4 || xmlHttp.status == 200)
..via my Script Debugger.

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="AjaxTesting.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <title>WebForm1</title>
        <meta name="GENERATOR" content="Microsoft Visual Studio .NET
7.1">
        <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5";>
        <!-- Start script -->
        <script language="javascript">
var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject()
{
  var xmlHttp;
   if(window.ActiveXObject)
   {
      try
      {
         xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch (e)
      {
         xmlHttp = false;
      }
   }
   else
   {
      try
      {
         xmlHttp = new XMLHttpRequest();
      }
      catch (e)
      {
         xmlHttp = false;
      }
   }
   if (!xmlHttp)
      alert("Error creating the XMLHttpRequest object.");
   else
   return xmlHttp;
}
function process()
{
       varWBS =
encodeURIComponent(document.getElementById("TextBox1").value);
       xmlHttp.open("GET", "test.aspx?WBS=" + varWBS);
       xmlHttp.onreadystatechange = handleServerResponse;
       xmlHttp.send(null);
}
function handleServerResponse()
{
   if (xmlHttp.readyState == 4 || xmlHttp.status == 200)
   {
     document.getElementById("show").innerHTML = xmlHttp.responseText;
   }
}
        </script>
        <!-- End script -->
    </HEAD>
    <body MS_POSITIONING="GridLayout">
        <form id="Form1" method="post" runat="server">
            <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 24px;
POSITION: absolute; TOP: 24px"
            runat="server" onblur='process()'></asp:TextBox>
            <div id="show" />
        </form>
    </body>
</HTML>

**********
**********

The code behind for the text.aspx page is very simple for now, and is:


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Server.HtmlEncode(Request.QueryString("WBS")).ToString =
"1.2.8.5.001" Then
            Response.Write("Please enter another WBS!")
        Else
            Response.Write("You can use this one!")
        End If
    End Sub

********************************************
*******************************************

bubberz wrote:
> Hello!  I'm a newbie to AJAX, and would really like to start using it
> with my web application.
>
> With the code below, what I'm trying to do is query the db and see if a
> number already exists once the user types the value into the textbox,
> then tabs out.  I'd rather do this, than cause a post back and then
> handle the number check that way.
>
> With another attempt at my first real AJAX app, here's the initial
> ASP.NET v1.1 page with the AJAX script in the Head tag, and I get the
> "Unknown error" in the handleServerResponse() when it's assigning
> "show" it's innnerHTML value:
>
> <%@ Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm1.aspx.vb" Inherits="AjaxTesting.WebForm1"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML>
>     <HEAD>
>         <title>WebForm1</title>
>         <meta name="GENERATOR" content="Microsoft Visual Studio .NET
> 7.1">
>         <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
>         <meta name="vs_defaultClientScript" content="JavaScript">
>         <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5";>
>         <!-- Start script -->
>         <script>
> var xmlHttp = createXmlHttpRequestObject();
> function createXmlHttpRequestObject()
> {
>   var xmlHttp;
>    if(window.ActiveXObject)
>    {
>       try
>       {
>          xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
>       }
>       catch (e)
>       {
>          xmlHttp = false;
>       }
>    }
>    else
>    {
>       try
>       {
>          xmlHttp = new XMLHttpRequest();
>       }
>       catch (e)
>       {
>          xmlHttp = false;
>       }
>    }
>    if (!xmlHttp)
>       alert("Error creating the XMLHttpRequest object.");
>    else
>    return xmlHttp;
> }
> function process()
> {
>        varWBS =
> encodeURIComponent(document.getElementById("TextBox1").value);
>        xmlHttp.open("GET", "test.aspx?WBS=" + varWBS);
>        xmlHttp.onreadystatechange = handleServerResponse;
>        xmlHttp.send(null);
> }
> function handleServerResponse()
> {
>    if (xmlHttp.readyState==4 || xmlHttp.readyState==200)
>    {
>      document.getElementById("show").innerHTML = xmlHttp.responseText;
>    }
> }
> </script>
>         <!-- End script -->
>     </HEAD>
>     <body MS_POSITIONING="GridLayout">
>         <form id="Form1" method="get" runat="server">
>             <TABLE id="Table1"  cellSpacing="1"
>                 cellPadding="1" width="75%" border="1">
>                 <TR>
>                     <TD>
>                         <asp:TextBox id="TextBox1" runat="server"
> onblur='process()'></asp:TextBox></TD>
>                 </TR>
>                 <TR>
>                     <TD>
>                     </TD>
>                 </TR>
>                 <TR>
>                     <TD>
>                         <asp:Button id="Button1" runat="server"
> Text="Button"></asp:Button></TD>
>                 </TR>
>             </TABLE>
>             <div id="show"></div>
>         </form>
>     </body>
> </HTML>
>
>
> **************
> **************
> The text.aspx page is simply this for the code behind:
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>         'Put user code to initialize the page here
>         If Server.HtmlEncode(Request.QueryString("WBS")).ToString =
> "1.2.8.5.001" Then
>             Response.Write("Please enter another WBS!")
>         Else
>             Response.Write("You can use this one!")
>         End If
>     End Sub


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to