By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,916 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,916 IT Pros & Developers. It's quick & easy.

problem with cookies and graphics

P: n/a
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
Nov 29 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.