Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

AJAX Callback in ASP.NET

Posted on 2013-01-07
3
Medium Priority
?
306 Views
Last Modified: 2013-01-07
Hello Experts,

I have a Dropdownlist, where I get the value of the selected one's and pass it through a callback server Pagemethod  which is STATIC, but I need to bind a Datagrid based on the value which I cannot do because of Static method.

I need to call a NON-Static method instead, how can I do this?
0
Comment
Question by:ASPDEV
3 Comments
 
LVL 12

Expert Comment

by:Jared_S
ID: 38751445
You'll need to create an instance of the class and invoke the method on it.

public class Foo
{
    public void Data1()
    {
    }

    public static void Data2()
    {
         Foo foo = new Foo();
         foo.Data1();
    }
}
0
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 1500 total points
ID: 38751735
No not possible , you cannot bind datagrid inside web method .

Other possible solution,
By sending data to client side and binding over there,
http://weblogs.asp.net/ahmedmoosa/archive/2010/10/30/bind-gridview-using-jquery.aspx
http://forums.asp.net/t/1774937.aspx/1


or else simply use updatepanel .
0
 

Author Closing Comment

by:ASPDEV
ID: 38752547
Thanks.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article discusses how to implement server side field validation and display customized error messages to the client.
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question