protected void posyback_Click(object sender, EventArgs e)
{
try
{
Qry = " SELECT FTYPE FROM STATUS,";
SqlCommand cmd = new SqlCommand(Qry, con);
SqlDataReader reader = cmd.ExecuteReader();
if (reader.HasRows)
{
while (reader.Read())
{
H_TYPE.Value = reader["FTYPE"].ToString();
}}
ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), "settype", "settype();", true);
BindGrid();//function for binding grid
}
}
initated settype function from code
but
if i use static i get
Error 1 An object reference is required for the nonstatic field, method, or property
if i remove static i get error
Message: 'PageMethods' is undefined
if i hardcode a value i get it
public static string Gettype(string type)
{
return "N";
//return "Hello " + H_TYPE.Value;
}