async void Button_Clicked(System.Object sender, System.EventArgs e) { if (KindUser.SelectedIndex == -1) { DependencyService.Get <IMessage>().ShortAlert("Select a Kind of User !"); return; } if (user_name.Text == "" || user_name.Text == null) { DependencyService.Get <IMessage>().ShortAlert("Enter User Name !"); user_name.Focus(); return; } if (Pass_Word.Text == "" || Pass_Word.Text == null) { DependencyService.Get <IMessage>().ShortAlert("Enter Password !"); Pass_Word.Focus(); return; } if (NickName.Text == "" || NickName.Text == null) { DependencyService.Get <IMessage>().ShortAlert("Enter NickName !"); NickName.Focus(); return; } string cc = ""; if (AdminPage.idd == 0) { cc = "user_name=" + user_name.Text + "&pass="******"&nick=" + NickName.Text + "&knd=" + KindUser.SelectedIndex + "&id=" + 0; } else { cc = "user_name=" + user_name.Text + "&pass="******"&nick=" + NickName.Text + "&knd=" + KindUser.SelectedIndex + "&id=" + AdminPage.idd; } var action = await DisplayAlert("Online Examination", "Add " + " New User " + " ? ", "Yes", "No"); if (action) { sav.IsEnabled = false; try { var current = Connectivity.NetworkAccess; if (current == NetworkAccess.Internet) { var formContent = new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>("id", "1"), }); string tt = "https://onlineexamination.a2hosted.com/OnlineExamination/insert_user.php?" + cc; var response2 = await App.con.PostAsync(tt, formContent); response2.Dispose(); CloseAllPopup(); MessagingCenter.Send <UserInfo>(this, "ref"); } } catch { } sav.IsEnabled = true; } }