Say I have a simple form with only two text boxes and a button. The text boxes have AutoPostBack
set to false. Say put some code inside of the TextChanged
event of those to write to the response stream saying which TextChanged event was fired after a button is clicked and the form is submitted to the web server. Is there a way to control the firing order of cached events?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace IsPostBack___Part_8
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
Response.Write("Text box 1 event fire");
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
Response.Write("Text box 2 event fired");
}
//dummy button click handler here
}
}
With that code and nothing else on the form it doesn't matter which text box is changed first, they fire in the same order. Is the firing order of cached events determined by its place in the html?