I am working on some ASP.NET Server Control, and I have an issue. Maybe I oversee something, I don't know.
Anyway:
public string Name
{
get
{
String s = (String)ViewState["name"];
return ((s == null) ? String.Empty : s);
}
set
{
ViewState["name"] = value;
}
}
protected override void RenderContents(HtmlTextWriter output)
{
txt.ID = Name; // Name here exists
txt.Text = DateTime.Now.ToShortDateString();
txt.RenderControl(output);
output.Write(someName(someValue));
}
public string GetCalendarString(string date)
{
some code...
// Name property is null
}
'RenderContents' uses property 'Name' to set the control name and then calls 'someName' function and 'someName' function also uses property 'Name', but when I run it, property 'Name' inside function 'someName' is empty, although in 'RenderContents' it is not.
Gremlins, or I'm missing something?