Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir,

I checked my code ..its perfect..During the pageload controls created dynamically are there.When i checked the source i can view the generated html inside the div(controls are created inside the tables.tables are inside the div) .But after i click the submit button and view the source im unable to see anything inside the div..This happens in mozilla only.


code snippet inline
once the page is loaded
<div id=aa runat="server">
<table id="tbl" cellspacing="3" cellpadding="0" width="330">
<tr>
<td colspan="2"><span id="lbl" style="display:inline-block;height:17px;width:150px;">lbl11</span></td>
</tr>
<tr>
<td width="170" align="left" valign="middle"><span id="lblaa" style="display:inline-block;height:17px;width:150px;">sddsd</span></td>
<td width="160" align="right" valign="middle">
&lt;select id=sel runat="server"&gt;
&lt;option value="abc"&gt;sss&lt;/option&gt;
&lt;option value="abc"&gt;sss&lt;/option&gt;
&lt;/select&gt;
</td>
</tr>
...next tr starts and it goes on and on...
</table>



will send the codebehind 2morrow sir..kindly help me..
Posted
Updated 15-Nov-10 3:11am
v4
Comments
balaji.t 16-Nov-10 8:10am    
The above question has been changed the above problem is due to mozilla's behavior

1 solution

Hi,

This happens most cases when you dynamically add controls while using Mozila. In IE, improper tag open/close is handled by browser. But mozila strictly looks for well defined DOM structure.

1. Make sure that tags are properly closed. Improper open close tag creates problem in Mozila.

2. Find out in the generated web page(where you dont get to see any control as of now) if control's corresponding HTML was generated. If HTML corresponding to controls you have added dynamically was generated but still dont see control, then put proper width/height is missing probably.

3. If you see that HTML was not generated, make sure that the container control( table or div whichever you might have taken ) is INDEED added to page coltrol collection. Sometime we miss to add the container control to the page's control connection.( you might have added button or checkbox to div or table, but div or table/td/tr was not added to page's control collection).

4. One debugging option is to put some background color (say red or blue)to individual control at the time of development just to make sure that the control you have added is not visible due to same color of the page. ( sometime page backgroud color becomes same as the controls color hence become tough to indentify).

If you still don't get that going, please post some code block here, the code snippet where you have added dynamically created controls to page.

Hope that helps,
 
Share this answer
 
Comments
Abhinav S 15-Nov-10 9:15am    
Good answer.

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