<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="FeedbackUpdate.aspx.cs" Inherits="FeedbackUpdate" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
function LoadDiv(url) {
var img = new Image();
var bcgDiv = document.getElementById("divBackground");
var imgDiv = document.getElementById("divImage");
var imgFull = document.getElementById("imgFull");
var imgLoader = document.getElementById("imgLoader");
imgLoader.style.display = "block";
img.onload = function () {
imgFull.src = img.src;
imgFull.style.display = "block";
imgLoader.style.display = "none";
};
img.src = url;
var width = document.body.clientWidth;
if (document.body.clientHeight > document.body.scrollHeight) {
bcgDiv.style.height = document.body.clientHeight + "px";
}
else {
bcgDiv.style.height = document.body.scrollHeight + "px";
}
imgDiv.style.left = (width - 650) / 2 + "px";
imgDiv.style.top = "20px";
bcgDiv.style.width = "100%";
bcgDiv.style.display = "block";
imgDiv.style.display = "block";
return false;
}
function HideDiv() {
var bcgDiv = document.getElementById("divBackground");
var imgDiv = document.getElementById("divImage");
var imgFull = document.getElementById("imgFull");
if (bcgDiv != null) {
bcgDiv.style.display = "none";
imgDiv.style.display = "none";
imgFull.style.display = "none";
}
}
</script>
<style type="text/css">
.auto-style1 {
width:500px;
margin-left:auto;
margin-right:auto;
text-align:left;
}
.auto-style2 {
text-align: right;
}
.modal
{
display: none;
position: absolute;
top: 0px;
left: 0px;
background-color:black;
z-index:100;
opacity: 0.8;
filter: alpha(opacity=60);
-moz-opacity:0.8;
min-height: 100%;
}
#divImage
{
display: none;
z-index: 1000;
position: fixed;
top: 0;
left: 0;
background-color:White;
height: 550px;
width: 600px;
padding: 3px;
border: solid 1px black;
}
* html #divImage {position:absolute;}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="masterpage_body" Runat="Server">
<table class="auto-style1">
<tr>
<td colspan="2">
<h1>User Feedback</h1>
</td>
</tr>
<tr>
<td class="auto-style2">Name:</td>
<td>
<asp:Label ID="lbl_Name" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">Email:</td>
<td>
<asp:Label ID="lbl_Email" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">Conduct:</td>
<td>
<asp:Label ID="lbl_Conduct" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">Other Feedback:</td>
<td>
<asp:Label ID="lbl_Feedback" runat="server" Height="52px" Width="105px"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style2">1st Image:</td>
<td>
<asp:ImageButton ID="Image1" runat="server" Height="150px" OnClientClick = "return LoadDiv(this.src);" Width="150px" Style="cursor: pointer" />
</td>
</tr>
<tr>
<td class="auto-style2">2nd Image:</td>
<td>
<asp:ImageButton ID="image2" runat="server" Height="150px" Width="150px" OnClientClick = "return LoadDiv(this.src);" Style="cursor: pointer" />
</td>
</tr>
<tr>
<td class="auto-style2">3rd Image:</td>
<td>
<asp:ImageButton ID="Image3" runat="server" Height="150px" Width="150px" OnClientClick = "return LoadDiv(this.src);" Style="cursor: pointer" />
</td>
</tr>
<tr>
<td class="auto-style2"> </td>
<td>
<asp:Button ID="btn_Reply" runat="server" OnClick="btn_Reply_Click" Text="Reply" />
</td>
</tr>
<tr>
<td class="auto-style2"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style2"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style2"> </td>
<td> </td>
</tr>
</table>
<div id="divBackground" class="modal">
</div>
<div id="divImage" class = "info">
<table style="height: 100%; width: 100%">
<tr>
<td valign="middle" align="center">
<img id="imgLoader" alt="" src="images/loader.gif" />
<img id="imgFull" runat="server" alt="" src="" style="display: none; height: 500px; width: 590px" />
</td>
</tr>
<tr>
<td align="center" valign="bottom">
<input id="btnClose" type="button" value="close" onclick="HideDiv()"/>
</td>
</tr>
</table>
</div>
</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class FeedbackUpdate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LuxiClass feedback = new LuxiClass();
int FeedbackId = int.Parse(Request.QueryString["FeedbackId"].ToString());
feedback = feedback.getFeedback(FeedbackId);
lbl_Name.Text = feedback.NickName;
lbl_Email.Text = feedback.Email;
lbl_Conduct.Text = feedback.Conduct;
lbl_Feedback.Text = feedback.OtherFeedback;
Image1.ImageUrl = "~\\Photo\\" + feedback.Image1;
image2.ImageUrl = "~\\Photo\\" + feedback.Image2;
Image3.ImageUrl = "~\\Photo\\" + feedback.Image3;
}
}
protected void btn_Reply_Click(object sender, EventArgs e)
{
int FeedbackId = int.Parse(Request.QueryString["FeedbackId"].ToString());
Response.Redirect("FeedbackEmail.aspx?FeedbackId=" + FeedbackId);
}
}
The enlarge image cannot be viewed when clicked.
New to asp.net,
Please help me.
Thank you so much in advance.