views:

38

answers:

1

Hi

On my webpage Im using EIT Lightbox to display images. I need to click on the Lightbox hyper link by code. I have tried the following

body.Attributes.Add("onLoad", "document.getElementById(\"lbh1\").click()\n");
body.Attributes.Add("onload", "eval(document.getElementById(\"lbh1\").href);\n");

But neither seems to work. If I use the following code

body.Attributes.Add("onload", "alert('popup');\n");

The alert is displayed

Is there another way to do the click?

A: 

I'm guessing this doesn't work in Firefox. Check out this article: http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/ or just do a Google search on simulating mouse events and/or clicks.

Bialecki