I have a page with a table on it with some informa开发者_运维技巧tion. I also have an asp.net button that I use to send an e-mail with the table markup. Currently, I am regenerating the table and storing it in a string and sending that as the body of the E-mail. What I would like to do instead is use JQuery's html function to grab the table markup of the page and store that in the variable to be used the e-mail body. Can someone provide an example?
There are a good amount of ways you could construct something like this. A quick search of JQuery syntax returns the method with which you can return an elements HTML contents:
$('div.demo-container').html();
http://api.jquery.com/html/
It would be possible to construct your Javascript in a way which grabs the return call from the html() method in JQuery and stores that value in a asp:Hidden before posting your form back to the server. Your postback reference to that hidden field would then include the markup you desire.
精彩评论