I have a problem in my code.
I am putting a image icon in my coe and want to call the code behind function Left_Click() on its OnClick() event.
But the Click event is generating after two times clicking.
and I have wriiten in the Page Load event
I want to write in PageLoad() method

as.Add.Attributes("onclick","javascript:Lef_Click();return false;);

For this I have to write a javascript function Lef_Click() and have to call that code behind function Left_Click() in it.
Is there any method to do this.
Please! Help me out.

u can call a code behind function from JS as

var str = '<%=M1()%>'

where M1() is a server side function . it shuold return some string to JS variable str.

How can i send parameters to the function?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.