Dear All
Iam using file upload control and i want to display image in another pop up page
.But image is not displaying in image control iam sending image path thru querystring . here is my code -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
-
-
<!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>Untitled Page</title>
-
<script language="javascript" type="text/javascript">
-
function test()
-
{
-
debugger;
-
var str;
-
str=document.getElementById("FileUpload1").value;
-
alert(document.getElementById("FileUpload1").value);
-
window.open('DisplayImage.aspx?url='+str,'','height=300,Width=300,Status=no,toolbar=no,Menubar=no,Location=noresizable=yes');
-
}
-
</script>
-
-
</head>
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
<table>
-
<tr>
-
<td>
-
<asp:FileUpload ID="FileUpload1" runat="server" Height="25px" Width="240px" />
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<asp:Button ID="btnUpload" runat="server" Text="Button" OnClientClick ="test()" />
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<asp:Label ID="lblmessage" runat="server" Text="Label"></asp:Label>
-
</td>
-
</tr>
-
</table>
-
</div>
-
</form>
-
</body>
-
</html>
-
-
[code]
//page in which image is displayed -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
-
-
<!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>Untitled Page</title>
-
</head>
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
<table>
-
<tr>
-
<td>
-
-
-
<asp:Image ID="Image1" runat="server" Height="200px" Width="200px" />
-
</td>
-
</tr>
-
</table>
-
</div>
-
</form>
-
</body>
-
</html>
-
public partial class DisplayImage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string s;
if (!IsPostBack)
{
s = Request.QueryString["url"].ToString();
//Image1.Src = s;
//Image1 = new Image();
Image1.ImageUrl= s.ToString();
Image1.Visible = true;
Response.Write(s);
}
}
}
thankx in advance
yogesh
7 2389
Dear All
I have created an application to diaplay image in popup window. In Internet explorer 6.0 image is displayed but not in Internet Explorer 7.0
Here is my code
Dear All
Iam using file upload control and i want to display image in another pop up page
.But image is not displaying in image control iam sending image path thru querystring . here is my code -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
-
-
<!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>Untitled Page</title>
-
<script language="javascript" type="text/javascript">
-
function test()
-
{
-
debugger;
-
var str;
-
str=document.getElementById("FileUpload1").value;
-
alert(document.getElementById("FileUpload1").value);
-
window.open('DisplayImage.aspx?url='+str,'','heigh t=300,Width=300,Status=no,toolbar=no,Menubar=no,Lo cation=noresizable=yes');
-
}
-
</script>
-
-
</head>
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
<table>
-
<tr>
-
<td>
-
<asp:FileUpload ID="FileUpload1" runat="server" Height="25px" Width="240px" />
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<asp:Button ID="btnUpload" runat="server" Text="Button" OnClientClick ="test()" />
-
</td>
-
</tr>
-
<tr>
-
<td>
-
<asp:Label ID="lblmessage" runat="server" Text="Label"></asp:Label>
-
</td>
-
</tr>
-
</table>
-
</div>
-
</form>
-
</body>
-
</html>
-
-
//page in which image is displayed -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
-
-
<!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>Untitled Page</title>
-
</head>
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
<table>
-
<tr>
-
<td>
-
-
-
<asp:Image ID="Image1" runat="server" Height="200px" Width="200px" />
-
</td>
-
</tr>
-
</table>
-
</div>
-
</form>
-
</body>
-
</html>
-
-
public partial class DisplayImage : System.Web.UI.Page
-
{
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
string s;
-
if (!IsPostBack)
-
{
-
s = Request.QueryString["url"].ToString();
-
//Image1.Src = s;
-
-
//Image1 = new Image();
-
Image1.ImageUrl= new Uri(s).ToString();
-
Image1.Visible = true;
-
Response.Write(s);
-
}
-
}
-
}
-
thankx in advance
yogesh
Frinavale 9,735
Recognized Expert Moderator Expert
//page in which image is displayed -
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DisplayImage.aspx.cs" Inherits="DisplayImage" %>
-
-
<!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>Untitled Page</title>
-
</head>
-
<body>
-
<form id="form1" runat="server">
-
<div>
-
<table>
-
<tr>
-
<td>
-
-
-
<asp:Image ID="Image1" runat="server" Height="200px" Width="200px" />
-
</td>
-
</tr>
-
</table>
-
</div>
-
</form>
-
</body>
-
</html>
-
-
public partial class DisplayImage : System.Web.UI.Page
-
{
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
string s;
-
if (!IsPostBack)
-
{
-
s = Request.QueryString["url"].ToString();
-
//Image1.Src = s;
-
-
//Image1 = new Image();
-
Image1.ImageUrl= new Uri(s).ToString();
-
Image1.Visible = true;
-
Response.Write(s);
-
}
-
}
-
}
-
thankx in advance
yogesh
Why are you using Response.Write?
Response.Write sometimes puts the content before the <html> tags in the page and this could be why things are not displaying.
-Frinny
Why are you using Response.Write?
Response.Write sometimes puts the content before the <html> tags in the page and this could be why things are not displaying.
-Frinny
As far as I've seen, Response.Write always puts the content before the <html> tags.
As far as I've seen, Response.Write always puts the content before the <html> tags.
If i comment response.write then also image is not displayed in I.E. 7.0
but dispalyed in I.E. 6.0
I want to display image in server machine and image resides in client machine using asp.net c#
Regards
Yogesh
Frinavale 9,735
Recognized Expert Moderator Expert
If i comment response.write then also image is not displayed in I.E. 7.0
but dispalyed in I.E. 6.0
As a rule, do not use Response.Write because it creates invalid HTML documents.
Run your application, right click on the page rendered in the browser and select View Code. Copy the line that contains the HTML that should be displaying the image (the <img> tag) and paste it here so that we can see what's wrong with it.
-Frinny
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Hari Prasad |
last post by:
Hi,
I have downloaded some image files by connecting to a URL and I am
trying open that image file using BrowserLauncher.
I am using windows xp and the default one to open image files is
windows...
|
by: Koh |
last post by:
My rollover image effect work fine in Netscape but not in Internet
Explorer. Is there any important element or tag that I have miss out
so it is not working in Internet Explorer? Below is my code,...
|
by: John |
last post by:
I am rotating images of different dimensions. My problem is that when
a new image is displayed in a new position which had an image of a
different dimension, the old image is first stretched to the...
|
by: UJ |
last post by:
I've got some HTML that produces what I need. I need to make an image of it
to display on pages of my web site (I won't go in to why - just trust me - I
need the image of it). The user enters some...
|
by: bissatch |
last post by:
Hi,
I have launched my new website and having viewing it on the Mac
Internet Explorer, have found that it isnt displaying my
background-image property. Is this a common bug / occurance? How are...
| |
by: huntingseasonson |
last post by:
Hi, I have set up the following page http://gertrudischale.com/cgi/
viewart.pl?lang=en&i=22 to scroll in the same direction one moves the
mouse. This works fine -except in IE- where the image tends...
|
by: =?Utf-8?B?TWlybw==?= |
last post by:
Hello!
I've seen a lot of post about this but every one of them ends up with the
same solution:
Set:
Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
past.......
|
by: OBAFGKM_RNS |
last post by:
I have a javascript timer on my page that counts to 10. Every half
second it alternates images on my buttons from a lighter image to a
darker image, giving the appearance of the buttons blinking....
|
by: Andrew Bailey |
last post by:
Hi,
Thanks for taking the time to read this. I would be very grateful if you are
able to help me solve the two problems below...
PROBLEM 1:
I spent a lot of time finding code that would...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |