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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:15:58+00:00 2026-05-15T02:15:58+00:00

This is what I have implemented, for further code, how to send the text

  • 0

This is what I have implemented, for further code, how to send the text of the text box to the server to store in variable or database without post back?

It can be done by using Ajax and update plane, but I would like to implement it using a JavaScript script.

<div id="CommentID" style=" width:30%; height:30%">
   <asp:Button ID="Button1" runat="server"
        Text="Comment"
        OnClientClick="visibleDiv('id1'); return false;" />

   <div id="id1" runat="server" style="visibility: hidden; background-color:Green; width:100%; height:100%">
       <asp:TextBox ID="TextBox1" runat="server"
            AutoCompleteType="Disabled" Rows="3"
            TextMode="MultiLine" Width="98%">
       </asp:TextBox>
       <asp:Button ID="Button2" runat="server"
            Text="Post"
            onclick="Button2_Click" />
       <asp:Button ID="Button3" runat="server"
            Text="Cancel"
            OnClientClick="visibleDiv('id1'); return false;" />
    </div>
</div>
  • 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-15T02:15:58+00:00Added an answer on May 15, 2026 at 2:15 am

    Skip jQuery, just add use a PageMethod

    This will expose a static server side method in javascript and facilitate all the Ajax stuff

    Add this to your code behind

    [System.Web.Services.WebMethod]
    public static string SendString( string text ) {
        // store the string in the database
        return text;
    }
    

    Add a scriptmanager to your markup

    <form runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"/>
        ...
    

    And now you can call SendString from javascript using

     PageMethods.SendString("mystring", function(text){
         alert("wooot! " + text);
     });
    

    Also note that you can use strongly typed parameters and return values.
    ASP.NET AJAX will automatically create client side classes in javascript to emulate the server side ones, and will automatically serialize and deserialize them 🙂

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

Sidebar

Related Questions

I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
Has anyone done this / have some example code?
I have this code in jQuery, that I want to reimplement with the prototype
I have this question: Does implementing a custom MembershipProvider class needs you to implement
This probably sounds really stupid but I have noo idea how to implement jquery's
I have a custom class that implements that IComparable. This class is stored in
I have a custom class that implements ICollection , and this class is readonly,
Let's say I have a class that implements the IDisposable interface. Something like this:
Actually, this question seems to have two parts: How to implement pattern matching? How
Running ipconfig /all shows a Teredo Tunneling Pseudo-Interface. What is that? Does this have

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.