I'm using C# and asp.net to query a web service.
The user will enter the number of guests and then I need to add that number of guests to the web service call. Creating the guests manually like this works.
// Create room layout for searching
Guest adult = new Guest();
adult.Id = 1;
adult.Title = "Mr";
adult.Firstname = "Test";
adult.Surname = "Test";
Guest adult2 = new Guest();
adult2.Id = 2;
adult2.Title = "Mr";
adult2.Firstname = "Test";
adult2.Surname = "Test";
Guest[] adults = new Guest[] { adult,adult2 };
The user chooses the number of adults on my sites search page, I do not know the number of adults and want to be able to add them dynamically to the web service call. I will be recieving the number of adults like this
int numberofguests = Convert.ToInt32(search.Guest);
I have tried numerous ways of doing it, but can't get it to work
Thanks