<%@ 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>