<%@ Page Language="C#" AutoEventWireup="True" %>
<Script language="C#" runat="server">
void Page_Load(Object Sender,EventArgs e){
int IntStr;
string Str;
char CharStr;
if (!IsPostBack){
Label_1.Text="Please input Number string in TextBox!";
}
else{
IntStr=Int32.Parse(Input_1.Value); //字符串型转换成整型
Str=IntStr.ToString(); //整型转换成字符串型
CharStr=Str[1]; //把字符串中的第二个字符赋值给字符型变量
Response.Write(CharStr);
}
}
</Script>
<form id="Form_1" runat="server">
<input id="Input_1" type="text" runat="server"/>
<input id="Button_1" type="Submit" value="Button" runat="server"/>
</form>
<asp:label ID="Label_1" runat="server"></asp:label>