473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with rendering page using 'Response.Redir ect' and 'Response.Outpu tStream'

Hi,

I want to include a graphic made in file2 into file. File must first send a
value to file2 (with Response.Redire ct) which will be used for the graphic.
My problem is that only the graphic is rendered and not the content of
file1.

Thanks for help.
André
See how i did:
file1:
-----
Dim lit As LiteralControl
Dim frm As HtmlForm = Me.FindControl( "form1")
Dim l As New Label
l.Text = "this is the graphic"
frm.Controls.Ad d(l)

Response.Redire ct(String.Forma t("redirect2.as px?Item0={0}", 25))
lit = New LiteralControl( "<img src=""redirect2 .aspx""/>")
frm.Controls.Ad d(lit)
file2 (redirect2.aspx ):
----------------------
Dim item0 As String
item0 = Request.QuerySt ring("Item0")

Dim objBitmap As New Bitmap(200, 104)
Dim objGraphic As Graphics = Graphics.FromIm age(objBitmap)
Dim redBrush As New SolidBrush(Colo r.Red)
.....

Response.Conten tType = "image/gif"
objBitmap.Save( Response.Output Stream, ImageFormat.Gif )

Nov 30 '06 #1
3 2125
Andre, I thought we'd already resolved this.
You must use an img tag to refer to the other page.
Response.Redire ct will not work.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"André" <hjhhb@ddwrot e in message
news:uh******** *****@TK2MSFTNG P02.phx.gbl...
Hi,

I want to include a graphic made in file2 into file. File must first send
a value to file2 (with Response.Redire ct) which will be used for the
graphic.
My problem is that only the graphic is rendered and not the content of
file1.

Thanks for help.
André
See how i did:
file1:
-----
Dim lit As LiteralControl
Dim frm As HtmlForm = Me.FindControl( "form1")
Dim l As New Label
l.Text = "this is the graphic"
frm.Controls.Ad d(l)

Response.Redire ct(String.Forma t("redirect2.as px?Item0={0}", 25))
lit = New LiteralControl( "<img src=""redirect2 .aspx""/>")
frm.Controls.Ad d(lit)
file2 (redirect2.aspx ):
----------------------
Dim item0 As String
item0 = Request.QuerySt ring("Item0")

Dim objBitmap As New Bitmap(200, 104)
Dim objGraphic As Graphics = Graphics.FromIm age(objBitmap)
Dim redBrush As New SolidBrush(Colo r.Red)
....

Response.Conten tType = "image/gif"
objBitmap.Save( Response.Output Stream, ImageFormat.Gif )
Nov 30 '06 #2
a redirect send a redirect header to the browser, which then does a new
request. you can not send content and a redirect. by default asp.net stops
running code (by aborting the thread) after sending the redirect header.

-- bruce (sqlwork.com)
"André" <hjhhb@ddwrot e in message
news:uh******** *****@TK2MSFTNG P02.phx.gbl...
Hi,

I want to include a graphic made in file2 into file. File must first send
a value to file2 (with Response.Redire ct) which will be used for the
graphic.
My problem is that only the graphic is rendered and not the content of
file1.

Thanks for help.
André
See how i did:
file1:
-----
Dim lit As LiteralControl
Dim frm As HtmlForm = Me.FindControl( "form1")
Dim l As New Label
l.Text = "this is the graphic"
frm.Controls.Ad d(l)

Response.Redire ct(String.Forma t("redirect2.as px?Item0={0}", 25))
lit = New LiteralControl( "<img src=""redirect2 .aspx""/>")
frm.Controls.Ad d(lit)
file2 (redirect2.aspx ):
----------------------
Dim item0 As String
item0 = Request.QuerySt ring("Item0")

Dim objBitmap As New Bitmap(200, 104)
Dim objGraphic As Graphics = Graphics.FromIm age(objBitmap)
Dim redBrush As New SolidBrush(Colo r.Red)
....

Response.Conten tType = "image/gif"
objBitmap.Save( Response.Output Stream, ImageFormat.Gif )
Dec 1 '06 #3
But there is a <imgtag refering to the other page in my code.

Now my problem is then: how to pass data to the graphic from page 1 and
getting the graphic back into page 1?
I used 'redirect' because in another thread in this group, they adviced me
to use 'redirect' to pass data to another page instead of cookies ...

Thanks again


"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.nets chreef in
bericht news:47******** *************** ***********@mic rosoft.com...
Andre, I thought we'd already resolved this.
You must use an img tag to refer to the other page.
Response.Redire ct will not work.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"André" <hjhhb@ddwrot e in message
news:uh******** *****@TK2MSFTNG P02.phx.gbl...
>Hi,

I want to include a graphic made in file2 into file. File must first send
a value to file2 (with Response.Redire ct) which will be used for the
graphic.
My problem is that only the graphic is rendered and not the content of
file1.

Thanks for help.
André
See how i did:
file1:
-----
Dim lit As LiteralControl
Dim frm As HtmlForm = Me.FindControl( "form1")
Dim l As New Label
l.Text = "this is the graphic"
frm.Controls.A dd(l)

Response.Redir ect(String.Form at("redirect2.a spx?Item0={0}", 25))
lit = New LiteralControl( "<img src=""redirect2 .aspx""/>")
frm.Controls.A dd(lit)
file2 (redirect2.aspx ):
----------------------
Dim item0 As String
item0 = Request.QuerySt ring("Item0")

Dim objBitmap As New Bitmap(200, 104)
Dim objGraphic As Graphics = Graphics.FromIm age(objBitmap)
Dim redBrush As New SolidBrush(Colo r.Red)
....

Response.Conte ntType = "image/gif"
objBitmap.Save (Response.Outpu tStream, ImageFormat.Gif )

Dec 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2807
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like Session("UserType") = "Sales". Then based on the Session("UserType") I use response.redirect to take the user to a specific page. The logic and...
0
1701
by: WebHouse.Co | last post by:
Hi Sir I'm in my 2nd year in M.Sc. degree & I made a project about the powerful tools SQLXML 3.0 & updategram, so I made a list of programs which r they so similar to the example that using updategram with ASP That exist in the documentation of the Microsoft SQL Server XML Tools as the following page: Sample ASP Application
1
4741
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I...
9
2217
by: Steve Peterson | last post by:
Hi I have an .aspx web form in which I would like to output only XML, no HTML. The datasource is a datatable that's bult on the fly based on user input from previous .aspx page so the XML output has to be genereated in the code behind. I was wondering if there is an elegant way of doing this in .NET using the ..NET classes...
2
2578
by: Jeronimo Bertran | last post by:
Hello, I am using a rendering aspx page to display a database image on an Image control. When the database record is retrieved, I am saving the bitmap to a session variable for the rendering aspx to load. Here is the code on the rendering page: CODE FOR ImageForm.aspx private void Page_Load(object sender, System.EventArgs e)
6
7256
by: A.M-SG | last post by:
Hi, Within my code behind's Page_Load event, I need to prevent the aspx contents be rendered. I tried to use Response.End() , but ASP.NET gives me "System.Threading.ThreadAbortException" exception. I also tried Response.OutputStream.Flush(); Response.OutputStream.Close();
1
1293
by: Blasting Cap | last post by:
I am using the following code to pull an image out of a database & display it on a web page. Dim data As New data Dim sID As String = Request.Params("itemID") Dim sqlConnection As New SqlConnection(data.connectionString) Dim sqlCom As New SqlCommand("Select Data, Type From tblImageStorage Where (Story_ID='" & sID & "')", sqlConnection)...
0
1867
by: ponvijaya | last post by:
Hi all, I have one requirement in my project. I need to download a file from the server tot the client machine. And after downloading it , it should be redirected to another jsp file. The code for download write inside a servlet is as follows public class DownloadServlet extends HttpServlet { public void doGet(HttpServletRequest...
1
3525
by: shahidrasul | last post by:
i want to download a file which user select from gridview, downloading is completing without problem but after download i want to refresh my page because i do some changes in db . but when refresh.redirect() occure it give me error that can't redirect because headers have been sent following are my code to download file
0
7912
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1180
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.