의 양식에서 웹 서비스의 웹 metod로 데이터 보내기 Windows Phone 7 용 응용 프로그램을 작성하고 있습니다. 여기에는 다음 텍스트 필드와 1 개의 라디오 버튼이있는 양식이 있습니다. 양식의 텍스트 필드 이름은 다음과 같습니다.Windows phone 7 응용 프로그램
이름, 나이, sadd, cadd, eadd, phn, zip. 라디오 버튼의 XAML은 다음과 같습니다
<TextBlock Canvas.Left="20" Canvas.Top="157" Height="44" Name="gen" Text="Gender" Foreground="Black" FontFamily="Verdana" FontSize="24" Width="134" />
<RadioButton Canvas.Left="139" Canvas.Top="157" FontStyle="Italic" GroupName="Gender" Foreground="Black" Content="Male" Height="71" Name="male" Width="154" />
<RadioButton Canvas.Left="139" Canvas.Top="207" FontStyle="Italic" GroupName="Gender" Foreground="Black" Content="Female" Height="71" Name="fem" Width="140" />
지금 내가 다음과 같은 방법으로 이러한 필드가 포함 된 웹 메소드 registertoteam에 이러한 데이터를 보낼 :
이름, STREET_ADDRESS, city_address, ZIP_CODE, EMAIL_ADDRESS을, phone_no, 나이, 성별
제출 버튼에 다음 코드를 작성했습니다.
private void submit_Click(object sender, RoutedEventArgs e)
{
if (name.Text == String.Empty)
{
MessageBox.Show("Please Enter the name");
name.Focus();
}
if (age.Text == String.Empty)
{
MessageBox.Show("Please Enter the age");
age.Focus();
}
if (male.IsChecked == true)
{
string gender = male.Content.ToString();
}
else if (fem.IsChecked == true)
{
string gender = fem.Content.ToString();
}
else //none of them is selected.
{
MessageBox.Show("Please select your Gender");
}
if (sadd.Text == String.Empty)
{
MessageBox.Show("Please Enter the Street Address");
sadd.Focus();
}
if (cadd.Text == String.Empty)
{
MessageBox.Show("Please Enter the City Address");
cadd.Focus();
}
if (eadd.Text == String.Empty)
{
MessageBox.Show("Please Enter the Email Address");
eadd.Focus();
}
if (phn.Text == String.Empty)
{
MessageBox.Show("Please Enter the Phone Number");
phn.Focus();
}
if (zip.Text == String.Empty)
{
MessageBox.Show("Please Enter the Zipcode");
zip.Focus();
}
else
{
var svc = new KejriwalService.aapSoapClient();
svc.registerToTeamAsync(name.Text, sadd.Text, cadd.Text, zip.Text, eadd.Text, phn.Text, age.Text);
}
}
else 부분에서는 코드가 해당 웹 메소드 (예 : registertoteam)의 데이터를 제출하기를 원합니다. else 부분에 쓴 코드는 작동하지 않으며 오류도 있습니다. else 부분에서 코드를 편집하여 데이터가 제출되도록하십시오. 감사합니다
오류의 종류, 컴파일 타임 또는 런타임 오류? 및 오류 메시지? – har07
@ har07 컴파일 타임 오류. 이게 내가하는 올바른 방법인가? 몇 달 전에이 도움을 받았어. 사실 나는 지금 사무실에 없기 때문에 오류를 정확하게 게시 할 수 없습니다. 이 점에 대해 제발 도와주세요. 당신이 지금까지 저를 위해 쓴 모든 코드는 절대적으로 훌륭하게 작동했습니다. 당신은 내가 else 부분에 넣어야하는 코드를 작성할 수 있습니까? – bhaku
아무도 웹 서비스를 알지 못하면 그 부분에서 사용할 작업 코드를 작성할 수 없습니다/호출 할 수 있습니다. 그것은 추측 작업입니다 (나는이 문제에 관한 이전 질문에서 그것을했습니다). 최소한 서비스 주소 – har07