PDA

View Full Version : فراخوانی جاوا اسکریپت در پیج لود



aboulfazl950
شنبه 08 شهریور 1393, 17:10 عصر
سلام کد جاوا اسکریپت زیر را چطور در پیج لود صدا بزنم؟


<script type="text/javascript"> function create(template, vars, opts) { return $container.notify("create", template, vars, opts); } $(function () { $container = $("#container").notify(); create("withIcon", { title: 'Admin', text: 'به سایت خوش آمدید', icon: 'alert.png' }, { expires: false }); });</script>


در حقیقت می خواهم متن و عنوان notify را از پایگاه داده بگیریم. و به جاوا اسکریپت بالا پاس دهم.

aminmousavi
شنبه 08 شهریور 1393, 17:40 عصر
سلام با کد زیر میتونی این کار رو انجام بدی : (کافیه کد جاوا رو درون متغیر str ذخیره کنید - بدون تگ <script ...)


string str = "";
ScriptManager.RegisterClientScriptBlock(Page,this. GetType(), "YourScript", str, true);