コード例 #1
0
 //Muligvis ud
 protected void submitexistingusername_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(existingusername.Value))
     {
         existinguserwarning.Visible   = true;
         existinguserwarning.InnerText = "A player name must be typed in";
     }
     else
     {
         try
         {
             MainClient.ReadAPlayer(existingusername.Value);
             Response.Redirect("~/Party?player=" + existingusername.Value);
         }
         catch (Exception ex)
         {
             if (ex is PlayerException)
             {
                 existinguserwarning.Visible   = true;
                 existinguserwarning.InnerText = "Player name doesnt exist";
             }
         }
     }
 }