SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Newbie to Ajax getting IE Unkown error

    With another attempt, here's the initial ASP.NET v1.1 page with the AJAX script in the Head tag, and I get the IE "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

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have "semi" resolved this issue, but am now running into a different issue/error on a different line.

    This topic I'm guessing is closed. I've made a new post to separate the issues.

    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •