Files
mono/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
T
Gonzalo Paniagua Javier 26c28da391 2002-09-23 Gonzalo Paniagua Javier <[email protected]>
* HtmlAnchor.cs:
	* HtmlButton.cs:
	* HtmlContainerControl.cs:
	* HtmlControl.cs:
	* HtmlForm.cs:
	* HtmlGenericControl.cs:
	* HtmlImage.cs:
	* HtmlInputButton.cs:
	* HtmlInputCheckBox.cs:
	* HtmlInputControl.cs:
	* HtmlInputFile.cs:
	* HtmlInputHidden.cs:
	* HtmlInputImage.cs:
	* HtmlInputRadioButton.cs:
	* HtmlInputText.cs:
	* HtmlSelect.cs:
	* HtmlTable.cs:
	* HtmlTableCell.cs:
	* HtmlTableRow.cs:
	* HtmlTextArea.cs: added almost all missing attributes.

svn path=/trunk/mcs/; revision=7740
2002-09-23 17:59:02 +00:00

63 lines
1.6 KiB
C#
Executable File

/* System.Web.UI.HtmlControls
* Authors
* Leen Toelen ([email protected])
*/
using System;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Web;
using System.Web.UI;
namespace System.Web.UI.HtmlControls{
[DefaultEvent("ServerChange")]
public class HtmlInputHidden : HtmlInputControl, IPostBackDataHandler{
private static readonly object EventServerChange = new object ();
public HtmlInputHidden () : base ("hidden")
{
}
bool IPostBackDataHandler.LoadPostData (string postDataKey,
NameValueCollection postCollection)
{
string postValue = postCollection [postDataKey];
if (postValue != null)
Value = postValue;
return false;
}
void IPostBackDataHandler.RaisePostDataChangedEvent ()
{
// don't need anything. LoadPostData always returns false.
}
protected virtual void OnServerChange (EventArgs e)
{
EventHandler handler = (EventHandler) Events [EventServerChange];
if (handler != null) handler.Invoke (this, e);
}
protected override void OnPreRender(EventArgs e){
if (Events[EventServerChange] != null && !Disabled)
ViewState.SetItemDirty("value",false);
}
[WebCategory("Action")]
[WebSysDescription("Fires when the value of the control changes.")]
public event EventHandler ServerChange{
add{
Events.AddHandler(EventServerChange, value);
}
remove{
Events.RemoveHandler(EventServerChange, value);
}
}
} // class HtmlInputFile
} // namespace System.Web.UI.HtmlControls