copying a list of words from excel to some asp.net text control
Say you had an Excel file containing a column filled with words, and you'd like to al开发者_运维百科low the user to copy the cells from that excel and paste them inside something like a textbox (we're talking ASP.NET 3.5). What would you do?
(Any other control would be fine, I just need something the code-behind can later on read from into a db.)
HELP?
When you copy a set of cells, and paste it into a plain text target (e.g. a textbox), it'll be inserted as a multiline text with tab-separated text values. In the example below I just pasted a set of 5 cells from Excel. And you're going to have no problem reading this data from the TextBox.Text property for processing. Bear in mind that since potentially you copy/paste cells from several rows, you should setup TextMode="multiline" in your TextBox.
Pasted cells:
A1 B1
A2 B2
A3
精彩评论