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

  • Home
  • SEARCH
  • 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 6560343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:26:50+00:00 2026-05-25T13:26:50+00:00

In my below code when is button clicked the textbox value is being added

  • 0

In my below code when is button clicked the textbox value is being added to the database and the same is displayed in the DataBinder are reloading the page. Well, just like chat script I need whole process to be done without postback. So, how to pass the value from textbox to DataBinder without reloading the page. i.e. How to perform Button Click such that it do not postback.

protected void Page_Load(object sender, EventArgs e)
    {
            string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=repeater;" + "UID=root;" + "PASSWORD=****;" + "OPTION=3";
            OdbcConnection MyConnection = new OdbcConnection(MyConString);
            try
            {
                MyConnection.Open();
                OdbcCommand cmd = new OdbcCommand("Select message from table1", MyConnection);
                OdbcDataReader dr = cmd.ExecuteReader();
                ArrayList values = new ArrayList();
                while (dr.Read())
                {
                    if (!IsPostBack)
                    {
                    string ep = dr[0].ToString();
                    values.Add(new PositionData(ep));
                    Shout_Box.DataSource = values;
                    Shout_Box.DataBind();
                    }
                }
            }
            catch
            {
            }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {   
            string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=repeater;" + "UID=root;" + "PASSWORD=*****;" + "OPTION=3";
            OdbcConnection MyConnection = new OdbcConnection(MyConString);
            OdbcCommand cmd = new OdbcCommand("INSERT INTO table1(message)VALUES(?)", MyConnection);
            cmd.Parameters.Add("@email", OdbcType.VarChar, 255).Value = TextBox1.Text;
            MyConnection.Open();
            cmd.ExecuteNonQuery();
            MyConnection.Close();
    }
  • 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-25T13:26:51+00:00Added an answer on May 25, 2026 at 1:26 pm

    A quick and dirty way would be to use an Update Panel. It would appear to your end-users to occur without a postback and you would only need to make minor changes to your page.

    More information: Introduction to the UpdatePanel control (MSDN)

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

Sidebar

Related Questions

In the below code when the play button is clicked Its value should be
I was given the code below to disable a button on an ASP.Net page
The below code should describe an app where once the widget button is clicked,
I am using VB.NET and below code on button click event. Protected Sub ibtnSendInvites_Click(ByVal
I am using jquery datepicker, please see below code $(document).ready(function() { $(.txtDate).datepicker({ showOn: 'button',
Below is sample code to create a radio button element with Yes/No options in
When running the below code a type is never returned, despite there being a
I am trying to code this from scratch, so that when a button clicked
The below code doesn't animate the button as expected. But it works if the
Below code saying error incorreect syntax near Main INSERT INTO tbl ( 'Week', Main,

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.