0

I have a menu.js file in solution, and a masterpage.aspx:

One of the codeblock of masterpage as follows

<body>
    <table id="table2" blah blah>
        <tr>
            <td valign="top">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td><img id="img" blah blah />
                        <td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="height: 14px">
                 <%SelectJSMenu%>
            </td>
       </tr>
   </table>
</body>

In code behind masterpage.aspx.vb

  Public Sub SelectJSMenu()
  {
      Select Case System.Configration.ConfigurationManager.AppSettinges("stage")
          Case 1
             Response.Output.Write("script") 'loading menu.js file via script
          Case 2
             Response.Output.Write("scirpt") 'loading another menu2.js file via this script

  }

What I have to do is to check the user permission and write this menu if user is not who he claims to be, then load the second.

2
  • your are not closing your <td>tags in the first table. It's a long time since I made some html, but It appears to me a problem. Commented Apr 17, 2014 at 22:34
  • And what exactly is the problem? Commented Apr 17, 2014 at 23:29

2 Answers 2

1

I'm not expert in js and asp but reviewing your post, I think the problem is that you don't close your <td> tag in the second enclosed table:

_edit: there's some exception in html which allow tag omission, and < td> tag is part of them. But complex parser could have a more strict validation stage that could complain about it.

try replace:

                <tr>
                    <td><img id="img" blah blah />
                    <td>
                </tr>

by:

                <tr>
                    <td>
                        <img id="img" blah blah />
                    </td>
                </tr>
Sign up to request clarification or add additional context in comments.

Comments

0

Apart from an issue with the closing of the tag as mentioned in @j-p's answer, the following needs to be corrected.

Instead of

 Case 1
             Response.Output.Write("script") 'loading menu.js file via script
 Case 2
             Response.Output.Write("scirpt") 'loading another menu2.js file

do-

Case 1
             Response.Output.Write("<script src=\"menu.js\"></script>") //loading menu.js file via script
 Case 2
             Response.Output.Write("<script src=\"menu2.js\"></script>") //loading another menu2.js file via this script

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.