• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 619
  • 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
 
Kiran SonawaneProject LeadCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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