Showing posts from May, 2010

ASP.NET dynamically generating javascript from a database for a div tag in pageload , vb code

ASP.NET dynamically generating javascript from a database in pageload , vb code

Here is an example to dynamically generate a javascript in pageload event for ur web application.

i have a div tag in mt default.aspx like this in body. remember this tag has already two .js files defined in head element. so my code may not work for you.. so write your own jscript.

<div id="fadeshow1" runat="server"></div>

i want to assign jscript for bday wishes of employees for that div page load i call a function loadwishes to create bday wish by opening the database in getwishemp function
do this in page load event

ProtectedSub Page_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.LoadIfNot Page.IsPostBack Then'this will be executed only first time any event happen on web page ClientScript.RegisterClientScriptBlock(Me.GetType(), "vinscript", loadwishes())EndIfEndSubPrivateFunction loadwishes() AsStringDim wishs…

Google+ Followers