Click here to Skip to main content
16,004,927 members
Home / Discussions / C#
   

C#

 
AnswerRe: Easy question Pin
Koushik Biswas12-Jan-06 6:01
Koushik Biswas12-Jan-06 6:01 
Questioncommands don't work??? Pin
melanieab12-Jan-06 4:56
melanieab12-Jan-06 4:56 
AnswerRe: commands don't work??? Pin
Michael Potter12-Jan-06 5:10
Michael Potter12-Jan-06 5:10 
QuestionDataSet and Database Pin
Sasuko12-Jan-06 4:53
Sasuko12-Jan-06 4:53 
AnswerRe: DataSet and Database Pin
harryjo12-Jan-06 5:09
harryjo12-Jan-06 5:09 
GeneralRe: DataSet and Database Pin
Sasuko12-Jan-06 12:35
Sasuko12-Jan-06 12:35 
GeneralRe: DataSet and Database Pin
Daniel Santillanes12-Jan-06 13:08
professionalDaniel Santillanes12-Jan-06 13:08 
QuestionRadioButtonList Control - Problems getting value from listItems programmatically added - HELP! Pin
Alan R. Smith12-Jan-06 4:43
Alan R. Smith12-Jan-06 4:43 
So here is my issue. I am communicating to UPS via there rate web service. I am retreiving the shipping options and costs and adding listItems to a radiogrouplist control (code below). I then have a button control that fires and event to take the value of the selectedItem and pass that through a calculateShipping() function...which updates order and cost. My problem is that when I fire the button event no value is able to be retrieved. I have tried retreiving the item.Text and nothing comes through there either. Here is the unusual point. If I manually add an item before the programmatic items are added then I can get the manually added items value..but none other. Am I building the line items incorrectly? Is this an issue with the control. PLEASE HELP!

C#

Code for programmatically adding listItems to the RadioButtonList control (rbUPS):

if (us.ServiceCode == ShipCode) {
ServiceName = ServiceName.Replace("®","");
odb.UpdateTempOrderShipping (cid,
ServiceName,
us.ServiceCharge * shipments *
decimal.Parse (ConfigurationSettings.AppSettings ["ShippingMultiplier"]));
this.rbUPS.Items.Add(new ListItem( ServiceName + " ($" + Math.Round(ShipCost,2) + ")", us.ServiceCode));
ListItem selectListItem = rbUPS.Items.FindByValue(ShipCode);
selectListItem.Selected = true;
}
else
{
this.rbUPS.Items.Add(new ListItem( ServiceName + " ($" + Math.Round(ShipCost,2) + ")", us.ServiceCode));

}

Code for the button control (updateShippingBtn):

public void UpdateShippingBtn_Click(object sender, System.EventArgs e)
{
if (rbUPS.SelectedIndex > -1)
{
string upsCode = rbUPS.SelectedValue;
//Response.Redirect("test.aspx?test=" + upsCode);
Session["ShipCode"] = upsCode;
}
else
{
Session["ShipCode"] = "03"; //UPS Ground Default
}
step.Value = "2";
headlineCheckoutStep.Text = titleCheckoutStep.Text = "Confirm Your Order";
checkoutStep.ImageUrl = ConfigurationSettings.AppSettings ["SystemImagePath"] + "steptwo.gif";
stepTwoPanel.Visible = true;
stepThreePanel.Visible = false;

CustomersDB cdb = new CustomersDB();
string cid = cdb.GetCustomerID();

calculateShipping (cid);
outputStepTwo (cid);
}


WHAT AM I DOING WRONG?
QuestionFinding strings in a project Pin
MartinSmith12-Jan-06 3:51
MartinSmith12-Jan-06 3:51 
QuestionMapping a Drive at runtime Pin
exhaulted12-Jan-06 2:49
exhaulted12-Jan-06 2:49 
AnswerRe: Mapping a Drive at runtime Pin
Koushik Biswas12-Jan-06 6:07
Koushik Biswas12-Jan-06 6:07 
GeneralRe: Mapping a Drive at runtime Pin
exhaulted12-Jan-06 9:08
exhaulted12-Jan-06 9:08 
Questionproblem with datagrid.unselect Pin
melanieab12-Jan-06 2:41
melanieab12-Jan-06 2:41 
AnswerRe: problem with datagrid.unselect Pin
exhaulted12-Jan-06 3:17
exhaulted12-Jan-06 3:17 
QuestionGenerics Problem Pin
Kevin McFarlane12-Jan-06 1:41
Kevin McFarlane12-Jan-06 1:41 
AnswerRe: Generics Problem Pin
mav.northwind12-Jan-06 5:18
mav.northwind12-Jan-06 5:18 
GeneralRe: Generics Problem Pin
Kevin McFarlane12-Jan-06 7:44
Kevin McFarlane12-Jan-06 7:44 
Questionplease correct my query Pin
Sasuko12-Jan-06 1:18
Sasuko12-Jan-06 1:18 
AnswerRe: please correct my query Pin
Colin Angus Mackay12-Jan-06 1:48
Colin Angus Mackay12-Jan-06 1:48 
GeneralRe: please correct my query Pin
Sasuko12-Jan-06 2:40
Sasuko12-Jan-06 2:40 
GeneralRe: please correct my query Pin
Colin Angus Mackay12-Jan-06 2:50
Colin Angus Mackay12-Jan-06 2:50 
AnswerRe: please correct my query Pin
Guffa12-Jan-06 2:23
Guffa12-Jan-06 2:23 
AnswerRe: please correct my query Pin
Sasuko12-Jan-06 4:49
Sasuko12-Jan-06 4:49 
QuestionUsing String.Replace method with variables Pin
sohne11-Jan-06 23:11
sohne11-Jan-06 23:11 
AnswerRe: Using String.Replace method with variables Pin
Colin Angus Mackay11-Jan-06 23:23
Colin Angus Mackay11-Jan-06 23:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.