There is an aspx page, html code is generated by clicking on the button with the help of LiteralControl. A certain number of buttons (input) is created depending on the number of records in the database. Clicking on a certain input calls the Test server method using PageMethods. Here is the method:
[WebMethod] [System.Web.Script.Services.ScriptMethod]
public static void Test(string ic1) { new main().Label1.Text = "123"; //main - это имя класса страницы } It is executed, but it throws an exception "The link to the object does not indicate an object instance". These components are placed in UpdatePanel so that the page is not updated ... The difficulty is that you cannot use response.redirect with a get request, since I need the page not to reload ... So I have to use PageMethods. What is the problem? Why is Label1 unavailable or from a static method in this case it needs to be called differently (the main class is non-static)? The question is how to refer to a non-static property of the same class from a static method or is it impossible ?? Thank you in advance!