My Client need a DNN module in which the dynamic generated Javascript should appear in the footer of the whole web portal. I have generated the code but it only appears on one page of the portal as soon as the page closes the script gone. as this script generated from a Module and that module is in only one page. so donno what to do with this situation, any Suggestion?
Asked
Active
Viewed 151 times
1 Answers
0
As you said you need to keep the dynamically generated script in Footer
control also.
For that, Can you keep the Literal control
in the Footer section
. Now, whenever the JavaScript
is generated dynamically, you have to keep the information in Session
variable.
Like this...
public class SessionCollection
{
public static String DynamicJavaScript
{
get
{
return Convert.ToString(HttpContext.Current.Session["DynamicJavaScript"]);
}
set
{
System.Web.HttpContext.Current.Session["DynamicJavaScript"] = value;
}
}
}
As you know the Flow of the Control goes like below.
- First Web Page will be executed.
- Next Master Page will be executed.
- Finally User Control will be executed.
Now, once the Master page will execute, the Session
value can be accessed in the Footer
Part. I am assuming that the Footer Contents are directly been used in Master Page
or another User Control
is prepared and used in the Master
Page.
Hope this will be useful...

Nilish
- 1,066
- 3
- 12
- 26