Regarding Backcolour

  • Thread starter Thread starter vimal.424
  • Start date Start date
V

vimal.424

hi all...........
my code is like.......
Image1.BackColor = System.Convert.ToDouble.Session["backcolor"];
found error i don't know how can i take session value background
colour in image1.BackColor

help me
Thanks
 
Well, there are a few issues here.

First, ToDouble is a method, so you have to do this:

Image1.BackColor = System.Convert.ToDouble(Session["backcolor"]);

Then, you have to make sure that there actually is a backcolor entry.
If the call to Session returns null, it will throw an exception when passed
to ToDouble.

Finally, the BackColor property is expecting a Color structure, so you
should convert whatever value is in "backcolor" to that.
 

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

Back
Top