Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I have tried to set z-index to an image from .cs page.
C#
for(int j=0;j<10;j++)
img[j].Attributes.Add("style", "Z-INDEX: 176; LEFT: 144px; POSITION: absolute; TOP: 111px");

showing me an error 'Object reference not set to an instance of an object.'

Please help. Thanks in advance
Posted
Updated 30-Apr-17 19:21pm
v2

1 solution

Try
C#
img[index].Style.Add("Z-INDEX", "value");
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900