我是JavaScript新手。基本上我想要一個JavaScript函數,它會在Web瀏覽器中顯示電子郵件預覽。我存儲了電子郵件的模板,正文和內容。使用ASP函數從C#字段或屬性中獲取值的Javascript函數
SQL:
SELECT Name, template, body, contents FROM Email
WHERE EmailID = 1
C#: 我asp.net頁上具有一個LinkButton(ID = 「lnkViewDoc」)和後面的代碼是:
lnkViewDoc.Attributes.Add("onclick", "return preview_email();");
JavaScript: 我需要一個函數,它將從類字段中選擇值並在Web瀏覽器中顯示它河感謝
function preview_email() {
..................
window.open() //Something
}
內容:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org
/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<center>
..................
</center>
</body>
身體:
<div style="text-align: left"> Dear .......,
...........................................
</div>
<div style="text-align: left"> </div>
[你有什麼試過?](http://whathaveyoutried.com) – Blachshma