<script runat="server">
void Button1_Click(object sender, EventArgs e) { string cousx; string lei = lx.SelectedItem.Value; switch (lei) { case "我": Response.Write("1"); cousx = "1"; break; case "你": Response.Write("2"); cousx =" 2"; break; case "他": Response.Write("3"); cousx = "3"; break; case "她": Response.Write("4"); cousx = "4"; break; }
Label1.Text =lei +","+cousx; //Use of unassigned local variable 'cousx' }