To work around this - set Disabled or ReadOnly from the client JavaScript when the page loads.
e.g.
function ExecuteOnLoad()
{
document.getElementById("txtInput").readOnly = true;
document.getElementById("txtOutput").disabled = true;
}
Prof. Tech. Blog.
function ExecuteOnLoad()
{
document.getElementById("txtInput").readOnly = true;
document.getElementById("txtOutput").disabled = true;
}
using System.Xml;
using System.Configuration;
using System.Data.SqlClient;
protected XmlDocument GetXML(int input)
{
const string strStoredProc = "SP";
const string ROOTNODE = "ROOT";
const string NODENAME = "NODE";
string sqlConnectionString = GetConnectionString();
SqlConnection sqlConnection = new SqlConnection(sqlConnectionString);
SqlCommand sqlCommand;
XmlDataDocument xmlDoc = null;
try
{
sqlCommand = new SqlCommand(strStoredProc, sqlConnection);
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.Parameters.Add("@INPUT", SqlDbType.Int);
sqlCommand.Parameters["@IN_Year"].Value = Int32.Parse(input);
sqlConnection.Open();
DataSet ds = new DataSet();
ds.DataSetName = ROOTNODE;
ds.Load(sqlCommand.ExecuteReader(), LoadOption.OverwriteChanges, NODENAME);
xmlDoc = new XmlDataDocument(ds);
}
catch (Exception ex)
{
}
finally
{
sqlConnection.Dispose();
}
return xmlDoc;
}