I resolved the problem...sort of. I decided to use colorbox instead of shadowbox to see if I had the same problem. This worked on the first try. I am still not sure why shadowbox would not work, but it doesn't really matter. Colorbox is smaller to load anyway, which is always a good thing. For anyone interested, below is the code that I used to get this to work:
01.
Private
Sub
Page_PreRender(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.PreRender
02.
' Register jQuery and colorbox
03.
Dim
colorbox_folder
As
String
= Globals.ApplicationPath &
"/Resources/Shared/Scripts/colorbox/"
04.
05.
'<script type="text/javascript" src="/dnn/Resources/Shared/Scripts/jquery/jquery.js" ></script>
06.
DotNetNuke.Framework.jQuery.RequestRegistration()
07.
08.
'<link rel="stylesheet" media="screen" href="/dnn/Resources/Shared/Scripts/colorbox/colorbox.css"></link>
09.
Dim
colorbox_stylesheet =
New
HtmlGenericControl(
"link"
)
10.
colorbox_stylesheet.Attributes.Add(
"rel"
,
"stylesheet"
)
11.
colorbox_stylesheet.Attributes.Add(
"media"
,
"screen"
)
12.
colorbox_stylesheet.Attributes.Add(
"href"
, colorbox_folder &
"colorbox.css"
)
13.
Page.Header.Controls.Add(colorbox_stylesheet)
14.
15.
'<script type="text/javascript" src="/dnn/Resources/Shared/Scripts/colorbox/jquery.colorbox-min.js"></script>
16.
Dim
colorbox_script =
New
HtmlGenericControl(
"script"
)
17.
colorbox_script.Attributes.Add(
"type"
,
"text/javascript"
)
18.
colorbox_script.Attributes.Add(
"src"
, colorbox_folder &
"jquery.colorbox-min.js"
)
19.
Page.Header.Controls.Add(colorbox_script)
20.
21.
'<script type="text/javascript">jQuery.noConflict();jQuery(document).ready(function() {jQuery("a[rel='colorbox']").colorbox({transition:"none", width:"80%", height:"80%"});});</script>
22.
Dim
colorbox_initiateScript =
New
HtmlGenericControl(
"script"
)
23.
colorbox_initiateScript.Attributes.Add(
"type"
,
"text/javascript"
)
24.
colorbox_initiateScript.InnerHtml =
"jQuery.noConflict();jQuery(document).ready(function() {jQuery("
"a[rel='colorbox']"
").colorbox({transition:"
"none"
", width:"
"80%"
", height:"
"80%"
"});});"
25.
Page.Header.Controls.Add(colorbox_initiateScript)
26.
27.
End
Sub