Hi, This is really driving me crazy having been on it for hours.
I have a url whose query strings are concatenated based on selected items on a form, I need to do a post to this url, but an imagebutton control has to be clicked for the post to occur. I put the PostBackUrl property of the imagebutton inside the event of the image button, hence causing it to be clicked twice before eventually posting the url... but i really need to click once but this aint working. I know why its clicking twice, tried calling the url with javascript but it wasnt working.
Below is the code. Please help me with code samples cos am still a newbie, kinda. Thanks
protected void searchImageButton_Click(object sender, ImageClickEventArgs e)
{
returntype = tidRadioButtonList.SelectedItem.Value;
dateDlabel = selddate1TextBox.Text.Trim();
dateAlabel = seladate1TextBox.Text.Trim();
depart = seldcity1DropDownList.SelectedItem.Value;
arrive = selacity1DropDownList.SelectedItem.Value;
flightclass = selcabinclassDropDownList.SelectedItem.Value;
adult = seladultsDropDownList.SelectedItem.Text;
child = selchildrenDropDownList.SelectedItem.Text;
infant = selinfantsDropDownList.SelectedItem.Text;
result = resultbyRadioButtonList.SelectedItem.Value;
promos = promocodeTextBox.Text.Trim();
string theURL = "http://yyy.xxx.com/CAB/SessionHandler.aspx?target=%2fCAB%2fIBE.aspx&pub=%2fng%2fEnglish&Tab=1&s=&h=?tid=" + returntype +
"&seldcity1=" + depart.Trim() + "&selddate1=" + dateDlabel + "&selacity1=" + arrive.Trim() + "&seladate1=" + dateAlabel + "&selcabinclass=" + flightclass
+ "&seladults=" + adult + "&selchildren=" + child + "&selinfants=" + infant + "&resultby=" + result + "&promocode=" + promos;
searchImageButton.PostBackUrl = theURL;
}