• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 787
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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