我无法从静态函数调用非静态函数(或)我想从静态函数调用 javascript 函数。
[WebMethod]
public static void add_items(string itemslist)
{
get_price(itemslist); // Error An object reference is required for non-static
//(or)
ScriptManager.RegisterStartupScript(this,
this.GetType(),
"script",
"<Script language='javascript' "
+ "type='text/javascript'>message();</script>",
false); //Error in this, this
}
protected void get_price(string item_id)
{
}