• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 610
  • Last Modified:

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
0
solution1368
Asked:
solution1368
  • 3
  • 2
1 Solution
 
Tom BeckCommented:
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

0
 
sonawanekiranCommented:
Just add  below line before for loop in BtnSubmit_Click method

 LblResult.Text = "";
0
 
solution1368Author Commented:
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

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_27868925.html
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
solution1368Author Commented:
Nice and Clean solution. Thanks
0
 
Tom BeckCommented:
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?
0
 
solution1368Author Commented:
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.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now