|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RealPage.aspx.cs" Inherits="SmartFormSample_RealPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
This is the real page. my address is
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br /><br />
<div style="float: left;width: 300px;margin-right: 20px">
What is your name? <br />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Please enter a name.">*</asp:RequiredFieldValidator>
<asp:Button ID="Button1" runat="server" Text="Go" OnClick="Button1_Click" /><br />
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
</div>
<div style="">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
</div><br style="clear:both" /><br />
<strong>The form tag on this page is:</strong><br />
<div id="resultDiv">
</div>
<br />
</div>
<script type="text/javascript">
(function ()
{
var resultDiv = document.getElementById("resultDiv");
var formTag = document.forms(0);
if (formTag != undefined && formTag != null &&
resultDiv != undefined && resultDiv != null)
{
var tagCode = (formTag.outerHTML) ? formTag.outerHTML : "";
if (tagCode.length > 0 && tagCode.indexOf(">") > -1)
{
tagCode = tagCode.substr(0, tagCode.indexOf(">") + 1);
}
// tagCode = tagCode.replace("<", "<");
// tagCode = tagCode.replace(">", ">");
resultDiv.appendChild(document.createTextNode(tagCode));
}
})();
</script>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been doing web development for about 11 years. I specialize in Dynamic HTML, C#, and SQL database design.