• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

Lightbox.js with asp.net button?

I am currently using lightbox.js ( http://www.huddletogether.com/projects/lightbox/ ) with some html links around my site. I would like to know how I can use this javascript with an asp.net button.

any ideas?
0
addicktz
Asked:
addicktz
  • 3
  • 3
1 Solution
 
tiagosalgadoCommented:
You can use ClientScript class.
In your button click event add this line
ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "alert('javascript is cool');",true);

Or add an attribute to onclick event.

At Page_Load
button1.Attributes.Add("onclick","alert('this is javascript');");
0
 
addicktzAuthor Commented:
I found this in the .js, I am guessing this is the function I would want to be using, however, when I try to do a clientscriptblock, the page reloads with "LyteBox.prototype.start('http://www.aol.com','true','true')" at the top. Any ideas?

Function I found

LyteBox.prototype.start = function(imageLink, doSlide, doFrame) {.....}

My code to start the function

ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "LyteBox.prototype.start('http://www.aol.com','true','true')");

0
 
tiagosalgadoCommented:
Try this:

ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "LyteBox.prototype.start('http://www.aol.com','true','true')",true);
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
addicktzAuthor Commented:
the Page just reloads with no other activity, I have tried both the page_load and click event methods, any other ideas? any chance you could take a look at the lightbox.js file? my javascript is weak at best.

thanks
0
 
tiagosalgadoCommented:
Have you add js file reference to your page?
0
 
addicktzAuthor Commented:
yes it is in the <head></head>

Also, I am sorry, I am using http://dolem.com/lytebox/ which is a version of lightbox



0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now