1

I'm using a 3-tier architecture for my application. I'm using inline code to call certain methods found in the business logic. I have a method which returns a particular string message. The following code is returning an error

<div id="logo">
<h1><a href="/" title='<%= systemMessagesBL.ReturnMessage("MSG_MAINPAGE_TOOLTIP", 1) %>'>Application</a></h1>
</div>

The error being: CS0103: The name 'systemMessagesBL' does not exist in the current context. And this although I already made a reference to it using the following embedded code:

<% BusinessLogic.SystemMessagesBL systemMessagesBL = new BusinessLogic.SystemMessagesBL(); %>

What may be the problem?

1
  • Can you put those 2 fragments into context? You can snip the irrelevant stuff in between. Commented Mar 24, 2012 at 9:04

1 Answer 1

1

Try declaring your object in a code-behind file, not inline, and make it protected:

protected BusinessLogic.SystemMessagesBL systemMessagesBL = 
   new BusinessLogic.SystemMessagesBL();

then your inline stuff should pick it up.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.