problem with cookies and graphics

A

André

Hi,

I try to insert a graphic (bitmap) to the first file. No problem any more
with that.
But the graphic generated in the second file (graf2.aspx) must receive
values from the the first file. I do that with
cookies. It works when i send ONE cookie, but if i send two cookies from the
first file, i get the browser-error: "can't render the page (or something
like that) ... check your configuration etc ...".

Maybe a conflict between the 'Response'?
Can you see the problem and maybe solve it?
Thanks


I show you my code:
first file:
-------
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
cok1.Value = 150
Response.Cookies.Add(cok1)
cok2.Value = 50
Response.Cookies.Add(cok2)
.....
lit = New LiteralControl("<img src=""graf2.aspx""/>")
frm.Controls.Add(lit)
.....

graf2.aspx
--------------------------------
Sub Page_Load(sender As Object, e As EventArgs)
Dim cok1 As New HttpCookie("cok1")
Dim cok2 As New HttpCookie("cok2")
Dim ja1, ja2 As String
Dim az,az2 As Integer
cok1 = Request.Cookies("cok1")
cok2 = Request.Cookies("cok2")
ja1 = cok1.Value
ja2 = cok2.Value
az = Convert.ToInt16(ja1) 'used in the graphic
az2 = Convert.ToInt16(ja2) 'used in the graphic
....
Dim objBitmap As New Bitmap(300, 200)
Dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
Dim redBrush As New SolidBrush(Color.Red)
objGraphic.FillRectangle(whiteBrush, 0, 0, 300, 200)
etc ...
.......
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top