access innerhtml property from static method

Mar 25 2018 2:44 PM
hi freind,
 
i have a requirement as below.
 
click  a button and jquery ajax code executes and returns a result.
 
meanwhile while c# code execute i want to update a div innerhtml in asp.net but unfortunately innerhtml unable to acess in static methord wheras ajax requires static methord.
 
so please help me how to call mom static methord or inner html from static method.
 
c# code below
 
namespace ARFAZ
{
public partial class index : System.Web.UI.Page
{
[System.Web.Services.WebMethod]
public static string Fetch_htmlcode(string FORMID, string ELEMENTID, string USER, string USERGROUP, string htmlcode)
{
string constring = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constring))
{
using (SqlCommand cmd = new SqlCommand("Fetch_htmlcode", con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@FORMID", FORMID);
cmd.Parameters.AddWithValue("@ELEMENTID", ELEMENTID);
cmd.Parameters.AddWithValue("@USER", USER);
cmd.Parameters.AddWithValue("@USERGROUP", USERGROUP);
cmd.Parameters.Add("@htmlcode", SqlDbType.NVarChar, -1);
cmd.Parameters["@htmlcode"].Direction = ParameterDirection.Output;
con.Open();
cmd.ExecuteNonQuery();
con.Close();
htmlcode = cmd.Parameters["@htmlcode"].Value.ToString();
index example = new index();
example.NonStatic(htmlcode);
return htmlcode;
}
}
}
public void NonStatic( string htmlcode)
{
arfaz_Section_11.InnerHtml = htmlcode;
}
 
}
 
i am getting error as 
 

Answers (3)