HTML Button Example in ASP.NET using C#

HTML Button Example in ASP.NET using C#


Posted in : ASP.Net Posted on : December 8, 2010 at 5:41 PM Comments : [ 0 ]

In this article we will introduce with HTML Button control in ASP.NET using C#.

HTML Button Example in Asp.net

HTML Button using in Asp.net Toolbox Controls using through HTML Tab. Button be drag in Asp.net Button.aspx  page .in this Example we can Take a Text field that show the before event : 'Question'. and after  button event fired then texfield show the result: 'Answer'.

Button.aspx (Design Page):

Button.aspx (source code):

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" 
AutoEventWireup="true" CodeFile="Button.aspx.cs" Inherits="Button" %>
<asp:Content ID="Content2" runat="server" 
contentplaceholderid="ContentPlaceHolder1">
<script runat="server" language="C#" >
protected void MySubmitHandler(object o, EventArgs e) {
inputText.Value = "Answer";
}
</script>
<div>
<h2><strong>Button.aspx:</strong></h2></div>
<div>
<input id="Submit1" type="submit" runat="server" value="Result" 
onServerClick="MySubmitHandler"/>
<input id="inputText" type="text" runat="server" value="Question" /></div>
&nbsp;
</asp:Content>

Output:

Download source code
Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics