How can table controls be copied?
table2=table1?
ASP.NET C# Visual Studio 2008 table control.
The reason is that it works for strings. Assume the below strings to be tables.
string full;
string userinput;
full = full + userinput;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit: Since answering this question back in June 2010, I have spent a lot of time using jQuery to do this kind of thing on the client. If interested in this approach, look into the jQuery clone() and append(), after(), before() and related methods.
End Edit
No, you can’t. Table, like any other control, is a reference type. It means that copying it just copies a reference to the real object instance. Because it doesn’t implement
System.ICloneableyou have to create a new one and then copy properties manually one by one.I would be curious to know why you are trying to do this, because it doesn’t seem to follow any of the best practices that I am familiar with. Could you describe what you are trying to do?
One thing you could do is copy the contents of a table, although this won’t copy the other properties such as styles and cell-padding etc: