Here's what I've got:
<textarea id="TextArea1" rows="6" cols="20" runat="server"></textarea>
and in the code-behind:
partial class _Default : System.Web.UI.Page
{
[Webmethod()]
public static void Data(int TestNum)
{
if (TestNum > 0) TextArea1.InnerText = "hello world";
}
}
And I'm getting the following error:
Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.
As I understand it, I need to declare an instance of the class within my shared function like so:
_Default NewInstance = New _Default();
NewInstance.TextArea1.InnerText = "hello world";
My question then is, is there any way I can avoid doing this? Is this bad practice and what kind of memory or performance penalty will I incur for doing this?
Thank you.
Edit: I should mention that the Static declaration is necessary for WebMethods