Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web form and C#
Message
General information
Forum:
ASP.NET
Category:
Web forms
Title:
Miscellaneous
Thread ID:
00901371
Message ID:
00906348
Views:
32
Cathi,

PMFJI, but

Do you think that panels would be a good approach when you need to have the same page with different number of controls (or different layout of controls) for different customers? That is, create one page and just change the panel, depending on the customer using the page. Does it make sense?


>Hi Jim,
>
>Using panels is a good way to organize your controls and turn them visibly on/off very easily. The HTML of the controls when visibly they are turned off are not even sent to the client, keeping the size of the file small.
>
>>Bonnie,
>>
>> I did debug the program and the ID property on the control was blank. So I don't know what was going on. I used a different method to fix the problem. I used a panel control, placed an HTML table in the panel and then the controls in the table. It's a better way of making it work.
>>
>>Thanks for your help,
>>
>>Jim
>>
>>>Jim,
>>>
>>>Hmmmm ... strange. Of the three controls you mentioned earlier ... have you stepped through the debugger to see what they are?
>>>
>>>~~Bonnie
>>>
>>>
>>>>Bonnie,
>>>>
>>>> Actually none of the controls are containers. I have 5 combo boxes, 11 text boxes, 2 buttons 4 checkboxes and 16 labels....
>>>>
>>>>Any other ideas?
>>>>
>>>>Jim
>>>>
>>>>>Jim,
>>>>>
>>>>>Since some controls are probably containers, you will need to do this recursively for all ContainerControls.
>>>>>
>>>>>~~Bonnie
>>>>>
>>>>>>Actually I found that the problem was the code behind page was pointing to a different page because I copied the HTML source from it into my new page. I resolved the problem.
>>>>>>
>>>>>> Another issue is popping up though. I want to loop through all the controls on the page. When I do a loop from 0 to controls.count the count is only 3. It should be more. Is there another way to loop through the controls collection? The code for the loop is below.
>>>>>>
>>>>>>
>>>>>>    for (int i = 0;i<=this.Controls.Count;i++)
>>>>>>        {
>>>>>>	   if (this.Controls[i].ID.Substring(3,6) == "Flight")
>>>>>>	        this.Controls[i].Visible = chkFlight.Checked;
>>>>>>	}
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>Jim
>>>>>>
>>>>>>>>All,
>>>>>>>>
>>>>>>>> I have a webform with a checkbox and a panel with some controls in it. I want the checkbox to show or hide the panel based on the value of the checkbox, but my code is not working. The code I have for the checkbox is below, please help.
>>>>>>>>
>>>>>>>>
>>>>>>>>private void chkFlight_CheckedChanged(object sender, System.EventArgs e)
>>>>>>>>  {
>>>>>>>>    pnFlight.Visible = chkFlight.Checked;
>>>>>>>>  }
>>>>>>>>
>>>>>>>
>>>>>>>Jim,
>>>>>>>
>>>>>>>Check your setting for the checkbox's AutoPostBack property. It needs to be set to True to get the behavior you need.
>>>>>>>
>>>>>>>hth,
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform