继续向前-------------------努力成为高手
不是的,我只是对他赋初值<br>
错误 8 应输入 class、delegate、enum、interface 或 struct 错误显示在</script> 这个我搞不懂啊
我的代码是这样的,希望你耐心一点不要太烦了,哎,关照下新手,
<%@ Page Language="C#"%>
<script language="c#" runat="server">
void WriteInfo(object serder, EventArgs e)
{ string[] strtemp = new string[5] { "<br/>", "<br/>", "<br/>", "<br/>", "<br/>" };
int i = 1;
strtemp[i] = "姓名:"+name.Text+"<br/>" + "<br/>";
if(ra1.Checked )strtemp[i]+="性别:"+"男";
else strtemp[i]+="性别:"+"女";
strtemp[i] += "生日:" + birthday.Text + "<br/>" + "学号:" + sno.Text + "email:" + email.Text+"<br/>" ;
strtemp[i] += "民族:";
strtemp[i] += content.Text.Replace(Convert.ToString(Convert.ToChar(13)), "<br>");
i++;
}
void putout(object serder, EventArgs e)
{ if (i == 5)
{
labContent1.Text = strtemp[i];
}
else
{ labContent1.Text = "请输入五个后再提交,否则重启程序"; }
}
}
</script>
<html>
<body >
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:18px" >
<tr>
<td>5.编写程序,让用户输入五个学生的姓名,年龄,住址,等信息,在提交后一起显示.</td>
</tr>
</table>
<hr style="color:Green"/>
<form runat="server" enctype="multipart/form-data">
<table style="width:700;font:14px;" border="0" cellpadding="0" cellspacing="0" / >
<tr style="background-color:#B5E1FF">
<td colspan ="2" style="font-size:16px;">个人资料</td>
</tr>
<tr>
<td >姓名<asp:TextBox runat="server" ID="name" MaxLength="40" /></td>
</tr>
<tr>
<td style="width:50%">性别<asp:radiobutton ID="ra1" runat="server" GroupName ="rg" Text="男" Checked="true" />
<asp:radiobutton ID="ra2" runat="server" GroupName ="rg" Text="女" Checked="false" /></td>
<td style ="width:50%">生日 <asp:TextBox runat ="server" ID="birthday" MaxLength ="10"/>(如:1986-05-05)</td>
</tr>
<tr><td style="width:50%">学号<asp:textbox ID="sno" runat="server" /></td>
<td style="width:50%">E-mail<asp:textbox runat="server" ID="email"/></td>
</tr>
<tr><td style="width:50%">民族<select id="nation" runat="server" ><option value="1">汉族</option><option value ="2">回族</option><option value="3">苗族</option><option value="4">藏族</option><option value="5"> 其他民族</option></select></td>
<td style="width:50%">你的职业<select><option>信息软件业</option><option>信息硬件业</option><option>其他行业</option></select></td>
</tr>
<tr> <td colspan="2">地址<asp:TextBox runat="server" ID="address" /></td>
</tr>
<tr>
<td> <asp:TextBox runat="server" ID="content" Columns="20" Rows="4" TextMode="multiline" Wrap="true" /><br />
<input type="button" runat="server" id="nextname" value="下一个" onserverclick="WriteInfo" /> <br />
<asp:Button runat="server" ID="lnksubmi" Text="提交" OnClick="WriteInfo" /><br /><br />
<asp:Label runat="server" ID="labContent1" /><br />
</td>
</tr>
</table>
</form>
</body>
</html>
结果还是提示编译器错误信息: CS1518: 应输入 class、delegate、enum、interface 或 struct 郁闷了
对了,帅哥你装了Microsoft Visual Studio 的吧,