944,082 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 52266
  • ASP.NET RSS
Sep 26th, 2007
0

Calling C# function(code behind) from javascript function

Expand Post »
Hi,

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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ninad is offline Offline
7 posts
since Sep 2007
Jun 27th, 2010
0
Re: Calling C# function(code behind) from javascript function
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
veeru8787 is offline Offline
1 posts
since Jun 2010
Sep 30th, 2010
0
Re: Calling C# function(code behind) from javascript function
How can i send parameters to the function?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mohanms is offline Offline
1 posts
since Sep 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Gridview
Next Thread in ASP.NET Forum Timeline: Help with retrieving database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC