Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Good Morning,
I have written a Web Method which is called by page method through Java script, this web method executes on button click and as it needed to be static i m not able to call the page controls thus i have another non static method to retrieve the value of radio-button. no as web service is called through Java script it executes before the static method. I want to first get the value of radio button and send the value to web service. Is it possible to call a non static method from the static method or any other way to call the web service later..?
Posted

Hello Gud Mrg

Plz Improve your question so that i can put better solution...

as i understand Put your Web Method in .asmx file and call method from JavaScript in this case you have no need to make a method as Static...also search for how to Web Methods in asp.net using .asmx file...

Let me know if it is helpful to you....

Thanx

Nitesh Meshram
 
Share this answer
 
using System;

public class MyClass {
// non-static method.
void nonStaticMeth() {
Console.WriteLine("Inside nonStaticMeth()");
}

/* Can call a non-static method through an
object reference from within a static method. */
public static void staticMeth(MyClass ob) {
ob.nonStaticMeth(); // this is OK
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900