0

I have following folder structure in my asp.net mvc 5 project. I able to call and pass parameters OnSubmit() webmethod using jquery script in my cshtml view-page.

enter image description here

now I want to call ShowReport() void method from OnSubmit() webmethod .this ShowReport() method I'm using to show RDLC report wizard

How can I do this

This is summary of my web-form code-behind file Incomplete_Prodcut.aspx.cs

public partial class Incomplete_Prodcut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }       

        /// Method to show RDLC report 
        public void ShowReport()
        {
            //Reset
            ReportViewer1.Reset();

            //DataSource
            DataTable dt = GetData(type.Text, category.Text, subsidary.Text, country.Text, dateHERE.Text);

            .............

        }


        public DataTable GetData(string type, string category, string country, string subsidary, string dateHERE)
        {
            ...............

            return dt;
        }

        [WebMethod]    
        public static string OnSubmit(string type, string category, string country, string subsidary, string dateHERE)
        {

            return "";
        }


    }
kez
  • 2,273
  • 9
  • 64
  • 123

1 Answers1

0

You are calling non-static method from static method. This can only be achieved with initializing the class and call its non-static method.

If you have a problem understanding difference between static and non-static methods here is a short explanation.

What's a “static method” in C#?

Community
  • 1
  • 1
MaticDiba
  • 895
  • 1
  • 11
  • 19