Solved

create table cells in javascript

Posted on 2016-08-13
6
98 Views
Last Modified: 2016-08-22
i have a table in asp
 <table id="mytable" width="100%" cellspacing="2" cellpadding="0" runat="server">
                    <tr>
                        <td></td>
                    </tr>
            </table>


and i am creating 3 cells in javascript but on postback this cells are removed
how to maintain them??
0
Comment
Question by:pamela rizk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:funwithdotnet
ID: 41755189
You'll have to recreate them after the post back.
0
 

Author Comment

by:pamela rizk
ID: 41755234
k thank you
0
 
LVL 57

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41756164
To explain further.

When your code runs on the server it produces HTML output which is sent to the browser. At this point your server code ceases to exist - as far as the browser is concerned - only the resulting HTML / CSS / JavaScript is relevant.
This runs in the browser independently of the server code. Anything done by JavaScript is invisible to server code UNLESS the JavaScript tells the server what it has done by means of a callback - usually using AJAX.
When you postback to the server - the only information sent to the server is the information that the server setup in the first place. If you modified this in the browser with JavaScript - the server has no way of knowing that you did this - unless you tell it.

If you modify the view with JavaScript and you postback to the server then if you want to see the modifications
a) You have to pass this information back to the server - either in the Post Back or in an AJAX call
b) The server will need to use this information to render out the new content when it sends back its response.
2
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 

Author Comment

by:pamela rizk
ID: 41758890
thank you mr julian as usual for your good explanation everytime
0
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 41758908
You are welcome.
0
 

Author Closing Comment

by:pamela rizk
ID: 41766364
this is the best explanation ever
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question