Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello i am working on a website so you can order online for a restaurant. I currently figured out how to get values of all checkboxes and dropdownlists but i still cannot seem to figure out radio buttons.
Right now i am just making a super string with all of the selected values but eventually i am going to want to make a receipt with a checkout page.
I have alot of plans to do this this but i am still getting use to the language.
XML and C#

I know both but i have never done them together. I am learning pretty quickly though.

C#
//this seems to work alright
            XPathNodeIterator toppingIterator = myNavigator.Select("//my:ToppersGroup", NamespaceManager);
            s +=+ "\n";
            while (toppingIterator.MoveNext())                      
            {
                XPathNavigator node = toppingIterator.Current;
                XPathNodeIterator children = node.SelectChildren(XPathNodeType.All);
                while (children.MoveNext())
                {
                    XPathNavigator child = children.Current;
                    if (children.Current.Value == "true")
                    {
                        s += children.Current.LocalName + "\n";
                    }
                }
                MessageBox.Show(s);
            }

//this is where i am having issues getting the selected values
            //RADIO BUTTON FRUIT OR VEGGIE STICK SELECTION
            XPathNodeIterator radiobtnIterator = myNavigator.Select("//my:FruitOrVeggieGroup", NamespaceManager);
            s += "\n" + "SIDE SELECTION" + "\n" + "-------------" + "\n";
            while (radiobtnIterator.MoveNext())
            {
                XPathNavigator node = radiobtnIterator.Current;
                XPathNodeIterator children = node.SelectChildren(XPathNodeType.All);
            }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900