locked
The name 'broker' does not exist in the current context RRS feed

  • Question

  • Hi I have written this code and it is throwing error stating that "The name 'broker' does not exist in the current context" :

    if (MyProposal.AonSite == "NONAON")
                        {
                            if (broker.OrganisationShortDescription.ToLower().Contains("calliden"))
                            {
                                p.AddPDFSection(strXml, Server.MapPath(versionPath + "Policy.xsl"), false);
                            }
                            else
                            {
                                p.AddPDFSection(strXml, Server.MapPath(versionPath + "Policy_Ace.xsl"), false);
                            }
                        }


    Durga

    Monday, April 18, 2016 3:49 AM

Answers

All replies

  • It sounds like a scope problem or a missing reference. You can post this in Visual C# forum for more assistance:

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=csharpgeneral

    Thanks,
    Sam Lester (MSFT)


    http://blogs.msdn.com/b/samlester

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Monday, April 18, 2016 11:59 AM
  • Hi Durga,

    The broker object is not available in that scope.

    You need to create / refer that object instance and then access its properties / methods.

    Thanks, SMSVikasK

    • Proposed as answer by SMSVikasK Wednesday, April 20, 2016 5:09 AM
    Monday, April 18, 2016 12:13 PM