asp.netでWebアプリケーションを作成しています。ページめくり効果が必要なので、turn.js(ref:http://www.turnjs.com/)を使用しました。今私はサーバーサイド、つまりコードビハインドでいくつかのデータを処理してクライアント側に送る必要があります。私は上のWebサイトからプロジェクトをダウンロードしました(from:https://github.com/blasten/turn.js)。しかし、問題は、実際に動的ページをロードしている.aspxページのコードビハインドからJavaScriptにデータを送信する方法を理解できないことです。C#を使用してasp.netの.aspxページのコードビハインドからjavascriptにサーバーサイドで処理されたデータを追加する方法#
function addPage(page, book) {
// First check if the page is already in the book
if (!book.turn('hasPage', page)) {
// Create an element for this page
var element = $('<div />', {'class': 'page '+((page%2==0) ? 'odd' : 'even'), 'id': 'page-'+page}).html('<i class="loader"></i>');
// If not then add the page
book.turn('addPage', element, page);
// Let's assum that the data is comming from the server and the request takes 1s.
setTimeout(function(){
element.html('<div class="data">Data for page '+page+'</div>');
}, 1000);
}
}
これは動的ページを追加するjavascript
関数です。どのように行のページの内容を追加するelement.html('<div class="data">Data for page '+page+'</div>');
私はひどく立ち往生して助けてください。あなたのコードであなたのaspxページで
お役立ち...どうもありがとう.. – Vikram