Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7618171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:19:50+00:00 2026-05-31T03:19:50+00:00

I have a weird issue that is probably simple here is the code js

  • 0

I have a weird issue that is probably simple here is the code

js file

    function visitorAction(firstnm,lastnm)
{

    var xmlhttp;


    xmlhttp=new XMLHttpRequest();


   xmlhttp.onreadystatechange=function()
   {
    if(xmlhttp.readyState==4 && xmlhttp.status==200)
        {
           document.getElementById('placeholder').innerHTML=xmlhttp.responseText;

        }

   }

  xmlhttp.open("GET", "Handler1.ashx?firstname="+firstnm+"&lastname="+lastnm, true);
   xmlhttp.send();
}

My webform –yes the js file is being correctly called

 <form id="form1" runat="server">
    <div>
    <table>
            <tbody>
                <tr>
                    <td>First Name</td>
                    <td><asp:TextBox ID="firstnameTextBox" runat="server"></asp:TextBox></td>
                    <td><asp:RequiredFieldValidator 
                    ID="RequiredFieldValidator1" 
                    runat="server" 
                    ErrorMessage="Fill in your first name"
                    ControlToValidate="firstnameTextBox"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td>Last Name</td>
                    <td><asp:TextBox ID="lastnameTextBox" runat="server"></asp:TextBox></td>
                    <td><asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator2" 
                        runat="server" 
                        ErrorMessage="Fill in your last name"
                        ControlToValidate="lastnameTextBox"></asp:RequiredFieldValidator></td>
                </tr>
            </tbody>
        </table>
        <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return visitorAction('firstnameTextBox','lastnameTextBox');">Login</asp:LinkButton>
        <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="Registration.aspx">Register</asp:LinkButton>
    </div>
    <div id = "placeholder">

    </div>

my handler

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CSC515_Project5_GREGORY
{

    public class Handler1 : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {

            context.Response.ContentType = "text/html";
            context.Response.Write("<html>");
            context.Response.Output.WriteLine("hello");
            context.Response.Write("</html>");

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

my issue is that the function does not work when I fill in anything in my input fields and click “login”. It should just return “hello” for testing but nothing happens and no console errors occur. When I click “login” without filling in any field it does what it is supposed to do. what gives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:19:51+00:00Added an answer on May 31, 2026 at 3:19 am

    remove the <html> part in the handler.context.Response.Output.WriteLine("hello"); is enough for you. see this site for more information about how to use ajax in asp.net applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird issue that's probably more of a bad coding than anything
I have a weird issue that only seems to be affecting IE 7. The
I have a weird issue. Here is the setup: I have a NSOperationQueue which
I have a weird issue. I receive the following error that causes a force-close:
I seem to have some weird issue going on that I am sure will
I'm having a weird issue that I can't track down... For context, I have
Having a weird issue. I'm new to Macs and have a windows VM that
I have this weird issue. I am trying to create a service that synchs
I have this weird issue that jquery.load sometimes fails on chrome. I'm not gonna
I have a weird issue that I am being asked to fix but alas

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.