Jwalin Khatri

Posts Tagged ‘Nullable Property

ASP.NET Custom Control Properties

Posted by: jwalin on: February 3, 2009

When authoring a custom ASP.NET control, I believe it a best practice to store public properties in the control’s viewstate. This applies to both controls inheriting from WebControl and to user controls.
[System.ComponentModel.DefaultValue("MyDefault")]
public string MyProperty
{
get { return ViewState["MyProperty"] as string ?? “MyDefault”; }
[...]


Blog Stats

  • 15,003 hits

  • jwalin: Follow the following steps 1]. open you Page in NOTEPAD. 2]. find the tag 3]. Replace the "body" like body oncontextmenu=”return false;" 4]. Sav
  • cytocine: Halu , how to put that , i mean where to put the part ?? i really dont know i hope you can help me out thanks..
  • elmerdolor: Halu , how to put that , i mean where to put the part ?? i really dont know i hope you can help me out thanks..