Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8165717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:37:34+00:00 2026-06-06T19:37:34+00:00

I have written my webmethod in aspx.cs file , but when i call n.Nautilus()

  • 0

I have written my webmethod in aspx.cs file , but when i call n.Nautilus() method in same page , i am unable to get the server side controls in Nautilus(), in this method controls becoming NULL , please find the reasons and solution to this problem as soon as possible.

[WebMethod]
        public static string Execute4()
        {
            NewQuote2 n = new NewQuote2();

            JavaScriptSerializer j = new JavaScriptSerializer();
            string r = string.Empty;
            var o = Observable.Start(() =>
            {
                // Thread.Sleep(7000);
                PennStar pn = new PennStar();
                r = j.Serialize(new { res = n.Nautilus() });
            }, Scheduler.NewThread);
            o.First();
           // r = n.Nautilus();
            return r;
        }

    public string Nautilus()
            {
                try
                {
                    if (ddlLineCode.SelectedItem.Value == "GL")
            {
                deductible = Convert.ToInt32(ddlGLdeductible.SelectedItem.Text);
                //ClassCode = Convert.ToInt32(ddlClassCode1.SelectedValues.ToString());
                ClassCode = Convert.ToInt32(ddlClasscode.SelectedValue);
            }
            else if (ddlLineCode.SelectedItem.Value == "PP" || ddlLineCode.SelectedItem.Value == "PR")
            {
                deductible = Convert.ToInt32(ddlPropdeductible.SelectedValue);
            }
            string T = ddlTerritory.SelectedItem.Text;

            QMSRatingEngine.Nautilus QR = new QMSRatingEngine.Nautilus();
            ArrayList Result = new ArrayList();

            if (LC == "GL")
            {
                QMSRatingEngine.NautilusAgents.ReturnGLRate gl = QR.GLRateObject(state, ED, deductible, ClassCode, ddlLimit.SelectedItem.Text, T);
                Result.Add(gl);
                getNautilusRatedata(gl);//this method code i can write the bellow
            }
            if (LC == "PP" || LC == "PR")
            {
                QMSRatingEngine.NautilusAgents.ReturnPropRate PRop = QR.PropertyRateObject(state, ED, ddlPropFormtype.SelectedItem.Text, ddlPropconstructiontype.SelectedItem.Text, ddlPropcovergetype.SelectedItem.Text, deductible, ddlPropuwscale.SelectedItem.Text, ddlPropprotectionclass.SelectedItem.Text, T);
                Result.Add(PRop);
            }
    }
return lbltext.Text;
    }

 private void getNautilusRatedata(QMSRatingEngine.NautilusAgents.ReturnGLRate gl)
        {
            lblNautilusPremiumbasis.Text = GetPremiumBasisFormat(txtExposure.Text);
            lblNautilusDeductible.Text = getCurrencyFormat(ddlGLdeductible.SelectedItem.Text);
            string Type = ddlPremiumBasis.SelectedItem.Text;
            decimal Premium = Convert.ToDecimal(gl.BaseRate_Prem.ToString());
            decimal nautilusPremiumBasis = Convert.ToDecimal(txtExposure.Text);
            decimal Prod = Convert.ToDecimal(gl.BaseRate_Prod.ToString());
            decimal CalcPremium = 0, CalcProd = 0;
            if (Type == "A - AREA" || Type == "M - ADMISSION" || Type == "U - UNITS" || Type == "O - OTHER")
            {
                CalcPremium = (Premium * nautilusPremiumBasis);
                lblNautilusPremisesOp.Text = getCurrencyFormat(Math.Round(CalcPremium).ToString());
                CalcProd = (Prod * nautilusPremiumBasis);
                lblNautilusProductsCoop.Text = getCurrencyFormat(Math.Round(CalcProd).ToString());
            }
            if (Type == "C - TOTAL COST" || Type == "P - PAYROLL" || Type == "S - GROSS SALES")
            {
                CalcPremium = (Premium * nautilusPremiumBasis) / 1000;
                lblNautilusPremisesOp.Text = getCurrencyFormat(Math.Round(CalcPremium).ToString());
                CalcProd = (Prod * nautilusPremiumBasis) / 1000;
                lblNautilusProductsCoop.Text =getCurrencyFormat(Math.Round(CalcProd).ToString());
            }
            lblNautilusGLPremium.Text = getCurrencyFormat(Math.Round((Math.Round(CalcProd) + Math.Round(CalcPremium))).ToString());
            lblNautilusSubTotal.Text = getCurrencyFormat(Math.Round((Math.Round(CalcProd) + Math.Round(CalcPremium))).ToString());
            lblNautilusGrandTotal.Text = getCurrencyFormat(Math.Round((Math.Round(CalcProd) + Math.Round(CalcPremium))).ToString());

            //string jstablelattest = "moneyCoverage";
            //ClientScript.RegisterClientScriptResource(this.GetType(), jstablelattest);
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:37:36+00:00Added an answer on June 6, 2026 at 7:37 pm

    Because you are calling Nautilus() function from public static string Execute4() and because Execute4() is a webmethod and thus static you are not able to find any controls as they are not static.

    You should try to return the results and values from your webmethod and do the operations like show/hide divs and other stuff with those results on the client side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have written a method; when I try to run it, I get the error:
I have written a small HTTP server and everything is working fine locally, but
I have written a web page that reads an input file and outputs a
Have written some RoR sites in the past, but never bothered too much at
I have written a sample web service, which consist of certain .aspx pages. I
I have written a app in PHP on my localhost server using XAMP, which
I have written a webmethod that returns the list of the Users althought the
I have written an AIR Application that downloads videos and documents from a server.
I have written following regex But its not working. Can you please help me?
I have written the following code to place the image path into sql server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.