Files
mono/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
T
Gonzalo Paniagua Javier 62aeab6dc1 2002-06-05 Gonzalo Paniagua Javier <[email protected]>
* System.Web.UI/AttributeCollection.cs: don't need a Hastable. StateBag
	now works fine and takes care of the details.

	* System.Web.UI/Control.cs: added HasChildren property.

	* System.Web.UI/StateBag.cs: fixed a couple of nasty bugs.

	* System.Web.UI.HtmlControls/HtmlButton.cs: RenderAttributes is an
	override, not new.

	* System.Web.UI.HtmlControls/HtmlContainerControl.cs: use the new
	Render method in HtmlControl.

	* System.Web.UI.HtmlControls/HtmlControl.cs: added Render method to
	render the tag and its attributes. Works for container and
	non-containers.

	* System.Web.UI.HtmlControls/HtmlImage.cs: RenderAttributes don't need
	to be new. Implemented Height property.

svn path=/trunk/mcs/; revision=5130
2002-06-05 15:58:32 +00:00

58 lines
1.3 KiB
C#
Executable File

/* System.Web.UI.HtmlControls
* Authors
* Leen Toelen ([email protected])
*/
using System;
using System.Web;
using System.Web.UI;
using System.Globalization;
namespace System.Web.UI.HtmlControls{
public class HtmlInputButton : HtmlInputControl, IPostBackEventHandler{
private static readonly object EventServerClick;
public HtmlInputButton(string type): base(type){}
protected void OnServerClick(EventArgs e){
EventHandler handler = (EventHandler) Events[EventServerClick];
if (handler != null){
handler.Invoke(this, e);
}
}
public void RaisePostBackEvent(string eventArgument){
if(CausesValidation == true){
Page.Validate();
}
OnServerClick(EventArgs.Empty);
}
public event EventHandler ServerClick{
add{
Events.AddHandler(EventServerClick, value);
}
remove{
Events.RemoveHandler(EventServerClick, value);
}
}
public bool CausesValidation{
get{
object causesVal = ViewState["CausesValidation"];
if (causesVal != null){
return (Boolean) causesVal;
}
return true;
}
set{
ViewState["CausesValidation"] = (Boolean) value;
}
}
} // end of System.Web.UI.HtmlControls.HtmlInputButton
} // namespace System.Web.UI.HtmlControls