⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default2.aspx

📁 网站系统建设
💻 ASPX
字号:
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    

    protected void Button1_Click(object sender, EventArgs e)
    {
      float rr;
     if(TextBox2.Text=="")
       Response.Write("请输入初始值.");   
     else
    {
    if (RadioButtonList1.SelectedIndex==0)
      rr=((float.Parse(TextBox2.Text)-32)*5/9);
    else
      rr=(float.Parse(TextBox2.Text)*9/5+32);
    TextBox3.Text=rr.ToString();  
    }
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label4" runat="server" BackColor="#FFFFC0" Font-Bold="True" ForeColor="Red"
            Text="First we learn how to use controls:" Width="282px"></asp:Label><br />
        <br />
        <asp:Label ID="Label1" runat="server" Text="let us see a example:" Width="153px"></asp:Label><br />
        <br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        <asp:TextBox ID="TextBox2" runat="server" Style="z-index: 100; left: 160px; position: absolute;
            top: 121px" ></asp:TextBox>
        <asp:TextBox ID="TextBox3" runat="server" Style="z-index: 101; left: 161px; position: absolute;
            top: 167px"></asp:TextBox>
        <asp:Label ID="Label2" runat="server" Style="z-index: 102; left: 23px; position: absolute;
            top: 122px" Text="the former value" Width="110px"></asp:Label>
        <asp:Label ID="Label3" runat="server" Style="z-index: 103; left: 49px; position: absolute;
            top: 168px" Text="result" Width="51px"></asp:Label>
        &nbsp;
        <asp:RadioButtonList ID="RadioButtonList1" runat="server" Style="z-index: 104; left: 82px;
            position: absolute; top: 210px" Width="164px">
            <asp:ListItem Selected="True">covert  to C</asp:ListItem>
            <asp:ListItem>covert to F</asp:ListItem>
        </asp:RadioButtonList>
        <asp:Button ID="Button1" runat="server" Style="z-index: 105; left: 132px; position: absolute;
            top: 291px" Text="Convert" Width="67px" OnClick="Button1_Click" />
        <asp:HyperLink ID="Next" runat="server" BackColor="#FFC0FF" ForeColor="Lime" Style="z-index: 107;
            left: 297px; position: absolute; top: 291px">Next</asp:HyperLink>
    
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -