Monday, December 4, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  77] [ 1]  / answers: 1 / hits: 25427  / 15 Years ago, wed, april 15, 2009, 12:00:00

I wish to call a method in my code behind from JavaScript, I sort of know how to do it.. I must call __DoPostBack passing name of control and parameters..

But what if an event doesn't exist i.e. NO CONTROL. Really what i am trying to do is call an event.. but the event doesn't exist as there is no control associated with it..

I sort of could do this:

If IsPostBack Then
If Request(”__EVENTTARGET”).Trim() = “CleanMe” Then
End If

But this means I must do it manually. Can I not wire up an event.... otherwise I will have loads of different IFs (i.e. If this passed then call this .. etc..).

Any ideas?


More From »


You may be able to use a PageMethod to call your codebehind function, here is a link to an example:

[#99700] Wednesday, April 8, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 490
Total Questions: 94
Total Answers: 94

Location: Lebanon
Member since Sun, Aug 2, 2020
3 Years ago