Link to home
Start Free TrialLog in
Avatar of solution1368
solution1368

asked on

asp.net / c#, wizard control

I have attached the codes and a screen shot for my questions.
Basically, I have wizard control and ascx for usercontrols.
my question is: when I click on the button first time inside of the ascx, everything works fine and I can see the value, however, I add more value like in the second, third, and fourth rows...and click on the button, it does not show any new values I just entered...

The screenshot can show you what I mean. Any ideas how to fix it?
InventoryList2.ascx
InventoryList2.ascx.cs
9-17-2012-6-32-19-PM.pdf
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

See if this gets you what you were expecting.
protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            string inflatableTmp = "ctl00$ContentPlaceHolder1$UiFormIndoorFacility$WizardIndoorFacility$UiInventoryList2$";
            LblResult.Text = "";
            for (int i = 1; i <= 20; i++)
            {                
                string inflatableQty = Request.Form[inflatableTmp + "TxtInflatableQty" + i];
                string inflatableDes = Request.Form[inflatableTmp + "TxtInflatableDes" + i];
                if (inflatableQty != "" || inflatableDes != "")
                {
                    LblResult.Text = LblResult.Text + inflatableQty + " " + inflatableDes + "<br>";
                }
            }

        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kiran Sonawane
Kiran Sonawane
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of solution1368
solution1368

ASKER

sonawanekiran: great you are the man. The issue is resolved. I added another question related to this one and hope you have time to help...

Thanks

https://www.experts-exchange.com/questions/27868925/asp-net-total-sum-and-validation.html
Nice and Clean solution. Thanks
I suggested it first, line 4 of the code I posted. You have another major problem that @sonawanekiran's "nice and clean solution" does not address. That is, you are printing "<br />" tags 20 times for every time you click that button. My solution corrects that problem. Can you please correct this unfairness?
well. my explaination is after I actually want to return 20 rows from codes even it is empty, and by adding initial value to null or "". It does work to me, and this is why an expert got a full point. I personally do prefer to read in text instead of coding.