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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:42:25+00:00 2026-06-09T01:42:25+00:00

The reason I ask is because I have an Update Panel filled with textboxes,

  • 0

The reason I ask is because I have an Update Panel filled with textboxes, labels, etc. that I make visible/invisble depending on what the user clicks. Later, I run a loop to clear all the textboxes. It used to work just fine, but now that I’ve added the AJAX Update Panel, it gives me an “Invalid postback or callback argument” error.

Is this because of that AJAX Update Panel? Or am I doing something completely wrong on my own?

Thanks,
Ellie

[EDIT]:
Okay, I’m adding a whole bunch of code because I have no idea where it’s coming from:

This is the method to write the record:

protected void AddEmployerRecord()
    {
        connection = new SqlConnection();
        connection.ConnectionString = "****";
        connection.Open();

        newEmployer = new EmployerCRUD(connection);

        employerRow.employerName = tb_employer.Text;
        employerRow.empPhone = tb_phone.Text;
        employerRow.empFax = tb_fax.Text;
        employerRow.empEmail = tb_email.Text;
        employerRow.empAddress = tb_address.Text;
        employerRow.empCity = tb_city.Text;
        employerRow.empState = ddl_state.SelectedValue.ToString();
        employerRow.empZIP = tb_ZIP.Text;
        employerRow.startDate = Convert.ToDateTime(tb_fromDate.Text);
        employerRow.endDate = Convert.ToDateTime(tb_toDate.Text);
        employerRow.startPay = Convert.ToDecimal(tb_startPay.Text);
        employerRow.endPay = Convert.ToDecimal(tb_endPay.Text);
        employerRow.leaveReason = tb_leaveReason.Text;
        employerRow.supervisorFName = tb_superFName.Text;
        employerRow.supervisorLName = tb_superLName.Text;
        employerRow.contactForRef = rbl_contact.SelectedValue.ToString();
        employerRow.jobDesc = tb_jobDesc.Text;
        employerRow.applicantID = 10010;
        //employerRow.applicantID = Convert.ToInt32(Session["ApplicantNum"]);
        employerRow.supervisorTitle = tb_superTitle.Text;
        employerRow.jobTitle = tb_jobTitle.Text;
        employerRow.startPayType = ddl_startPayType.SelectedValue.ToString();
        employerRow.endPayType = ddl_endPayType.SelectedValue.ToString();

        ct_emp = newEmployer.Add(employerRow);
        // *************** Error Message *************** //
        //if (ct_emp.Message != "OK")
        //    Error message
        //else
        //    

        connection.Close();
    }

And this is the method to load the grid:

protected void LoadGrid()
    {
        try
        {
            SqlConnection pConnection = new SqlConnection();
            pConnection.ConnectionString = "**";
            pConnection.Open();
            string sqlstatement = "SELECT EmployerID, EmployerName FROM dbo.EMPLOYER WHERE ApplicantID = @applicantID";
            command = new SqlCommand(sqlstatement, pConnection);
            command.Parameters.AddWithValue("@applicantID", 10010);
            //command.Parameters.AddWithValue("@applicantID", Session["ApplicantNum"].ToString().Trim());
            ds = new DataSet();
            adapter = new SqlDataAdapter(command);
            builder = new SqlCommandBuilder(adapter);
            adapter.Fill(ds);
            gv_employers.DataSource = ds.Tables[0];
            gv_employers.DataBind();
            pConnection.Close();
        }
        catch (Exception error)
        {
            Response.Write(error.Message);
        }
    }

Just as a sidenote, ApplicantID is only 10010 while I debug things (need consistency).

Also, I read somewhere that this problem occurs when you try to re-bind the data to the grid. I run that LoadGrid() method each time the page is reloaded. Should I bind the data somewhere else? If so, how?

  • 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-09T01:42:26+00:00Added an answer on June 9, 2026 at 1:42 am

    if you want a simple way to clear all text boxes use something like this

        public  void ClearTextItems(ControlCollection controls)
        {
            foreach (Control c in controls)
            {
                if (c is System.Web.UI.WebControls.TextBox)
                {
                    TextBox t = c as TextBox;
                    t.Text = string.Empty;
                }
            }
         }
    

    will need to see the other code where you are getting the PostBack Error…

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

Sidebar

Related Questions

The reason I ask this is because I have seen this page but I
The reason I ask is because I want to have one editable field where
Obviously the answer is no... right? The reason I ask is because I have
Reason I ask is because they suggest not to commit dependencies on your repos.
The reason I ask is, I have a web application written in Ruby (1.8.7-p357)
Does flash.security.allowDomain(*) allow for redirects? The reason why I ask is that I'm trying
Is a MainController.xib file required for every iOS project? Reason I ask is because
A few clients have asked to make some static websites because their hosting doesn't
And why don't they change it? Edit: The reason ask is because I'm new
I come into ASP.NET from php so the reason why i ask my question

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.