javascript for Random images pick
-
in a page i need to pick an image randomly/sequencly n display it on the page so i have taken a javascript as below var num=1 img1 = new Image () img1.src = "images\BD\img1.jpg" img2 = new Image () img2.src = "images\BD\img2.jpg" function slideshowUp() { num=num+1 if (num==2) { num=1 } document.BD.src=eval("img"+num+".src") } i have an imag tag
with this image tag i have kept the anchor tag to A HREF="JavaScript:slideshowUp()" asp:linkbutton id=Linkbutton3 runat="server" CssClass="Small" ForeColor="Blue" Text='<%# DataBinder.Eval(Container, "DataItem.Employee_Name") %>' /asp:linkbutton /A im getting the value of "DataItem.Employee_Name" from database table. but javascript is not working for LinkButton so pls help me in this issue?
-
in a page i need to pick an image randomly/sequencly n display it on the page so i have taken a javascript as below var num=1 img1 = new Image () img1.src = "images\BD\img1.jpg" img2 = new Image () img2.src = "images\BD\img2.jpg" function slideshowUp() { num=num+1 if (num==2) { num=1 } document.BD.src=eval("img"+num+".src") } i have an imag tag
with this image tag i have kept the anchor tag to A HREF="JavaScript:slideshowUp()" asp:linkbutton id=Linkbutton3 runat="server" CssClass="Small" ForeColor="Blue" Text='<%# DataBinder.Eval(Container, "DataItem.Employee_Name") %>' /asp:linkbutton /A im getting the value of "DataItem.Employee_Name" from database table. but javascript is not working for LinkButton so pls help me in this issue?
sivaram praveen wrote:
but javascript is not working
That's not a useful description of the problem. What does it do, and how does that differ from what you expected? Do you get any error message? Why are you using a LinkButton? That will do a postback, so your javascript will never be called.
Experience is the sum of all the mistakes you have done.