Remove Page_Load event from content page.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string script = "$(document).ready(function () { $('[id*=btnSubmit]').click(); });";
ClientScript.RegisterStartupScript(this.GetType(), "load", script, true);
}
}
Add a Button in master page and set Style="display: none;" with OnClick event.
<asp:Button ID="btnFake" Text="" Style="display: none;" runat="server" OnClick="SaveFake" />
Write the below code in master page.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string script = "$(document).ready(function () { $('[id*=btnFake]').click(); });";
Page.ClientScript.RegisterStartupScript(this.GetType(), "load", script, true);
}
}
protected void SaveFake(object sender, EventArgs e)
{
// Add Fake Delay to simulate long running process.
System.Threading.Thread.Sleep(2000);
}