T
tshad
I just started working with VS.net 2003 and am trying to get a Web Service
running. I got it working fine in VB.Net, but I can't seem to get it to go
to the Form_Load handler to call the service. From the book it is pretty
straight forward.
I added the form1_Load function to the default code:
********************************************************
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
localhost.Service1 WebServiceObject;
WebServiceObject = new localhost.Service1();
string Result;
textBox1.Text = "This is a test Before the Try/Catch secion";
try
{
textBox1.Text = WebServiceObject.HelloWorld();
}
catch (Exception Ex)
{
textBox1.Text = "Web Service Exception: " + Ex.Message;
}
}
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
}
}
}
***********************************************************************
The program works fine and stepping through it goes first to Main but never
goes to Form1_Load.
The Form opens and the default text that was in the box is still there.
Why doesn't the Form1_Load handler work? The book doesn't mention having to
do anything special to get it to run. It says that when you first run the
application, the program will call the form's Load handler (Form1_Load).
Did it leave out a step?
Thanks,
Tom
running. I got it working fine in VB.Net, but I can't seem to get it to go
to the Form_Load handler to call the service. From the book it is pretty
straight forward.
I added the form1_Load function to the default code:
********************************************************
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
localhost.Service1 WebServiceObject;
WebServiceObject = new localhost.Service1();
string Result;
textBox1.Text = "This is a test Before the Try/Catch secion";
try
{
textBox1.Text = WebServiceObject.HelloWorld();
}
catch (Exception Ex)
{
textBox1.Text = "Web Service Exception: " + Ex.Message;
}
}
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
}
}
}
***********************************************************************
The program works fine and stepping through it goes first to Main but never
goes to Form1_Load.
The Form opens and the default text that was in the box is still there.
Why doesn't the Form1_Load handler work? The book doesn't mention having to
do anything special to get it to run. It says that when you first run the
application, the program will call the form's Load handler (Form1_Load).
Did it leave out a step?
Thanks,
Tom