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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:17:53+00:00 2026-06-14T03:17:53+00:00

I am new to asp.net. Here I am trying to create a chat application.

  • 0

I am new to asp.net. Here I am trying to create a chat application. In my project there is one label and one TextBox. whenever the user enters anything in TextBox and press enter the text will be shown in Label. I tried the below code:

OnEnterKeyPress of TextBox (.aspx.cs file)

        HttpRequest request = base.Request;           
        Ping p = new Ping();
        PingReply r;
        String s = request.UserHostAddress;  //using own IP address for understanding purpose.
        r = p.Send(s);
        Response.Buffer = false;
        if (r.Status == IPStatus.Success)
        {
            Label1.Text = TextBox1.Text;
        }

I dont know how to keep the enter event. (There are no events in TextBox properties as it were in C#)

Before asking here I checked many links like Link1 Link2 Link3 but no use. I could have used simple Javascript but the main code is in C# file.

  • 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-06-14T03:17:54+00:00Added an answer on June 14, 2026 at 3:17 am

    You’ll need to put this in its own form and use javascript, since it will be in a page with other controls. You don’t want to “submit” the page every time they type something.

    <form action="javascript:chat()">
    put label and textbox here
    </form>
    

    This will make “enter” work for the textbox. For the chat feature, to make it more interactive, you can implement with http://signalr.net/

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

Sidebar

Related Questions

I have a new asp.net mvc project and i am trying to figure out
I'm new to ASP.NET MVC and I'm trying to create a very simple blog
I'm new to ASP.NET, and I'm trying to create a class that will call
I am new to ASP.NET MVC. I am trying to create what I thought
I am trying to create a login form on my ASP.NET website. Currently, there's
I am new to ASP.net MVC. I am trying to create a viewmodel to
I am trying to create a form application with asp.net C# that display question
I am trying to create a simple ajax chat using JQuery and ASP.NET. My
I am learning ASP.NET MVC 3 and trying to create a web application where
New ASP.NET Web API HttpClient has been giving me some strange results. Here is

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.