我做在asp.net web應用添加服務器端處理數據的JavaScript在.aspx頁面中。我需要翻頁效果,所以我使用了turn.js(ref:http://www.turnjs.com/)。現在我需要在服務器端處理一些數據,即代碼隱藏並將其發送到客戶端。我從上面的網站下載了該項目(來自:https://github.com/blasten/turn.js)。但問題是,我不知道如何將代碼隱藏的數據發送到實際加載動態頁面的.aspx頁面中的javascript。如何從代碼隱藏在asp.net使用C#
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>');
請儘快幫助我,我很困難。
有用的..謝謝了很多.. – Vikram 2012-04-11 16:33:39