1.View.ascx file deisgned with .css and .js.
2. css is supported but .js is not support in view.ascx.
for example: <script src=<%=ModulePath%>sample.js type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<%=ModulePath%>style.css" />
3. how to do to support the javascript in view.ascx?
4. This is code for view.ascx:
<%@ Control Language="C#" Inherits="SamModule.View" CodeBehind="View.ascx.cs" AutoEventWireup="true" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<!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 runat="server">
<title>SamModule</title>
<script src=<%=ModulePath%>1js type="text/javascript"></script>
<script src=<%=ModulePath%>2.js type="text/javascript"></script>
<link href=<%=ModulePath%>style.css rel="stylesheet" type="text/css" />
</head>
<body onload="loadimg();">
<form id="form1" runat="server">
<table cellpadding=0 cellspacing=0 border=0 class="overall">
<tr>
<td class="overall_left" valign=middle align=center width=160>
<div id="Divresult" runat="server">
</div>
</td>
<td class="overall_right" width=140>
<div>
<div class="left"><img src="SImage/stI1.gif" alt="" class=image onclick="Viewimage('stI1');" /></div>
<div class="right"><img src="SImage/stI2.gif" alt="" class=image onclick="Viewimage('stI2');" /></div>
</div>
<div>
<div class="left"><img src="SImage/stI3.gif" alt="" class=image onclick="Viewimage('stI3');" /></div>
<div class="right"><img src="SImage/stI4.gif" alt="" class=image onclick="Viewimage('stI4');" /></div>
</div>
<div>
<div class="right"><img src="SImage/stI5.gif" alt="" class=image onclick="Viewimage('stI5');" /></div>
<div class="left">
<div>
<div class="left_col"><img src="Color/C1.gif" alt="" class=image onclick="img('C1');" /></div>
<div class="right_col"><img src="Color/C2.gif" alt="" class=image onclick="img('C2');" /></div>
</div>
<div>
<div class="left_col"><img src="Color/C3.gif" alt="" class=image onclick="img('C3');" /></div>
<div class="right_col"><img src="Color/C4.gif" alt="" class=image onclick="img('C4');" /></div>
</div>
<div>
<div class="left_col"><img src="Color/C5.gif" alt="" class=image onclick="img('C5');" /></div>
</div>
</div>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
5. This code represented the images clickevent using javscript functionality. This code run in visualstudio2.0 (asp.net )
6. In dotnetnuke doenot work this code in view.ascx. where can i change? any idea?
This is Javascript code for 1.js:
var fn;
function Viewimage(filename)
{
fn=filename;
var obj = document.getElementById('Divresult');
var obj1 = document.getElementById('DivColor');
obj.innerHTML = "<img src='images/loading.gif' /> Processing...";
start = new Date();
start = start.getTime();
var exec = function(str)
{
if(str != "")
{
obj.innerHTML = "<img src=BImage/" + filename + ".gif alt='' />";
//obj.innerHTML = str;
}
}
var ajax = new doAjax();
ajax.doGet('getimage.aspx?id=' + filename + '&start=' + start,exec);
}
function loadimg()
{
fn='stI1';
var obj = document.getElementById('Divresult');
obj.innerHTML = "<img src=BImage/stI1.gif alt='' />";
}
function img(cname)
{
var cn;
cn = fn + '_' + cname;
var obj = document.getElementById('Divresult');
obj.innerHTML = "<img src='images/loading.gif' /> Processing...";
start = new Date();
start = start.getTime();
var exec = function(str)
{
if(str != "")
{
obj.innerHTML = "<img src=CImage/" + cn + ".gif alt='' />";
//obj.innerHTML = str;
}
}
var ajax = new doAjax();
ajax.doGet('getimage.aspx?id=' + cname + '&start=' + start,exec);
}
This is Javascript code for 2.js
function doAjax() {
this.req = null;
this.reqId = 0;
this.url = null;
this.status = null;
this.statusText = '';
this.method = 'GET';
this.async = true;
this.dataPayload = null;
this.readyState = null;
this.responseText = null;
this.responseXML = null;
this.handleResp = null;
this.responseformat = 'text', // 'text', 'xml', 'object'
this.mimeType = null;
this.headers = [];
var i = 0;
var reqTry = [
function() { return new XMLHttpRequest(); },
function() { return new ActiveXObject('Msxml2.XMLHTTP') },
function() { return new ActiveXObject('Microsoft.XMLHTTP' )} ];
while (!this.req && (i < reqTry.length)) {
try { this.req = reqTry[i++](); }
catch(e) {}
}
if (this.req) {
this.reqId = 0;
}
else {