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 6793107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:03:40+00:00 2026-05-26T18:03:40+00:00

I have two aspx page on my application. From the first one, lets say

  • 0

I have two aspx page on my application. From the first one, lets say default.aspx, I have one button and one textbox. When I click the button I do an ajax call to the checkname.aspx as below

            function docheck() {

            var un = $('#username').val();


            $.ajax({

                url: "checkname.aspx",
                data: { name: un, method: 'checkname' },
                dataType: 'script',
                success: function (val) {

                    if (val == "No")
                        alert("not valid");
                    else
                        alert("valid!");

                }

            });
        }

From checkname.aspx page I do the operations like below but it response is also adding the checkname.aspx page’s html to the response so the success message of ajax call doesnt became what I wanted. How do I send just what the CheckName method send.

checkname.aspx.cs

    protected void Page_Load(object sender, EventArgs e)
    {


  NameValueCollection queries = HttpUtility.ParseQueryString(Request.QueryString.ToString());

    if(queries["method"] == "checkname")
        this.CheckName(queries["name"]);
}

protected void CheckName(string Name)
{
    if (Name == "ryu")
    {
        HttpContext.Current.Response.Write("No");
        return;
    }

    HttpContext.Current.Response.Write("Yes");
}

Thanks in advance,

  • 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-26T18:03:41+00:00Added an answer on May 26, 2026 at 6:03 pm

    Call HttpContext.Current.Response.End(); to end processing your aspx request, otherwise, all stuff after that call in Page_Load gets processed normally, thus you’ve got the results you’ve described.

    But in general, follow the advices given by other people here, and work with your AJAX requests in different way.

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

Sidebar

Related Questions

I have an ASPX page with two RequiredFieldValidator and a button to go to
I have an aspx page with two buttons, one of the buttons has an
Let's say I have two files default.aspx and the associated default.aspx.cs . default.aspx.cs: protected
I have an asp page (Default.aspx) that displays the diff between two text files.
I have one web page MyWebPage.aspx which while loading has to show data from
I have a web application consisting of an aspx-file. On page load two textboxes
I have two pages. One aspx page and the other an aspx page but
I have two pages, the parent and from this page I am using: window.open('OrderDetailsFull.aspx?ObjectID='
I have a C#/ASP.NET .aspx page that declares two controls that each represents the
i have multilingual asp.net site. there is a masterpage and default.aspx. I put two

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.