VB questions in .NET env.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmoza
    New Member
    • Oct 2008
    • 4

    #1

    VB questions in .NET env.

    I am trying to execute the following steps so that excel gif button will show up but instead I am not getting anything. Please provide your help. Here is the code.

    Code:
    </SCRIPT>
    var myLocation<%=""%>  				
    var myLocation<%=myI%>
    var ReportName<%=myI%> = "Time in System Report"
    var SQLStr<%=myI%> = escape("<%=SQLStr%>");
    myLocation<%=myI%>="rMetricXL.aspx?RiskTable=" + SQLStr<%=myI%> + "&ReportName=" + ReportName<%=myI%>
    </SCRIPT>
    <a HREF=myLocation<%=myI%><img src="images/excelreport2.gif" BORDER="0" alt="Excel version of home list"></a>
    Last edited by Curtis Rutland; Oct 29 '08, 08:27 PM. Reason: added [CODE] tags
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    What exactly are we looking at here?
    It doesn't quite match the pattern of ASP.NET or html?

    Comment

    • mmoza
      New Member
      • Oct 2008
      • 4

      #3
      Originally posted by Plater
      What exactly are we looking at here?
      It doesn't quite match the pattern of ASP.NET or html?
      It is a combination of HTML, VB and Javascript. The file extenstion is aspx. The below part of the code does not work or I don't know how to make it work.

      Code:
      <TR>
      <TD ALIGN="CENTER" COLSPAN="15">
      <SCRIPT>
      var myLocation<%=""%>  
      var myLocation<%=myI%>
      var ReportName<%=myI%> = "Time in System Report"
      var SQLStr<%=myI%> = escape("<%=SQLStr%>");
      myLocation<%=myI%>="rMetricXL.aspx?RiskTable=" + SQLStr<%=myI%> + "&ReportName=" + ReportName<%=myI%>
      </SCRIPT>
      How can I translate the above script in the HREF so that a button is displayed and on click a report is generated.

      Code:
      <a HREF="rMetricXL.aspx?RiskTable=javascript:escape("<%=SQLStr%>")" "&ReportName=" + ReportName<%=myI%>> <img src="images/excelreport2.gif" BORDER="0" alt="Excel version of home list"></a>
      </TD>
      <%myI = myI + 1%>
       </TR>

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well you didn't name your <script> type, you should be including the type.
        <script type="text/javascript" language="Javas cript">
        That should help some.
        I am not positive that <% %> notation works inside the <SCRIPT> tags?
        I would recommend using the alert() function to see what your variables contain, perhaps they are not getting the values you think that they should?

        Comment

        • Curtis Rutland
          Recognized Expert Specialist
          • Apr 2008
          • 3264

          #5
          Please enclose your posted code in [code] tags (See How to Ask a Question).

          This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

          Please use [code] tags in future.

          MODERATOR

          Comment

          • mmoza
            New Member
            • Oct 2008
            • 4

            #6
            Originally posted by Plater
            Well you didn't name your <script> type, you should be including the type.
            <script type="text/javascript" language="Javas cript">
            That should help some.
            I am not positive that <% %> notation works inside the <SCRIPT> tags?
            I would recommend using the alert() function to see what your variables contain, perhaps they are not getting the values you think that they should?
            Thanks for your reply. They have not mentioned <script> type in the code. The code is exactly what I posted earlier. I am not sure if this piece of code is Visual Basic or VB script. They have not specified <script type="text/javascript"> language="Javas cript"> above these lines of code so I am guessing it is either VB script or visual basic. But I was also told that 'escape' is a javascript.

            Comment

            • Curtis Rutland
              Recognized Expert Specialist
              • Apr 2008
              • 3264

              #7
              Tell me, does the file end with .asp or .aspx?

              Comment

              • mmoza
                New Member
                • Oct 2008
                • 4

                #8
                Originally posted by insertAlias
                Tell me, does the file end with .asp or .aspx?
                The file ends in aspx

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  Originally posted by mmoza
                  They have not mentioned <script> type in the code. The code is exactly what I posted earlier.
                  I saw that it was not specified, I am saying that you NEED to specify it. It looks like javascript.

                  Comment

                  Working...