w3schools
  
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About

ASP.NET UseSubmitBehavior Property


Button Control Reference Complete Button Control Reference

Definition and Usage

The UseSubmitBehavior property specifies if the Button control uses the browser's built-in submit function or the ASP.NET postback mechanism.

This property is set to TRUE if the control uses the browser's submit function. FALSE otherwise. Default value is TRUE.

When set to FALSE, ASP.NET adds a client-side script to post the form. This enables control developers to use the GetPostBackEventReference method to return the client postback event for the Button.

Syntax

<asp:Button UseSubmitBehavior="TRUE|FALSE" runat="server" />

Example

The following example uses the ASP.NET postback mechanism:

<script runat="server">
Sub SubmitBtn(obj As Object, e As EventArgs)
  lblMsg.Text = "Submitted using the ASP.NET postback mechanism."
End Sub
</script>

<form runat="server">
Click the button:
<asp:button id="Button1" runat="server"
Text="Submit" onclick="SubmitBtn"
UseSubmitBehavior="FALSE" /><br />

<asp:label id="lblMsg" runat="server"/>
</form>

Show example »

Button Control Reference Complete Button Control Reference

DreamTemplate


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
Top Web Hosting
Windows Hosting
WEB BUILDING
XML Editor – Free Trial!
FREE Flash Website
FREE Web Templates
FLIGHT TICKETS
Find the cheapest flight
to any destination now!
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
STATISTICS
Browser Statistics
Browser OS
Browser Display