效果 代码 !-- directives -- % @Page Language="C#" % !--函数编写 -- script runat="server" private void convertoupper(object sender, EventArgs e) { string str = mytext.Value; changed_text.InnerHtml = str.ToUpper(); } /script !-- Layou
效果
代码
<!-- directives -->
<% @Page Language="C#" %>
<!--函数编写 -->
<script runat="server">
private void convertoupper(object sender, EventArgs e)
{
string str = mytext.Value;
changed_text.InnerHtml = str.ToUpper();
}
</script>
<!-- Layout -->
<html>
<head>
<title> 测试 </title>
</head>
<body>
<h3> 小写转换为大写 </h3>
<form runat="server">
<input runat="server" id="mytext" type="text" />
<input runat="server" id="button1" type="submit" value="Enter..." OnServerClick="convertoupper"/>
<hr />
<h3> 结果: </h3>
<span runat="server" id="changed_text" />
</form>
</body>
</html>