Connecting Tech Pros Worldwide Forums | Help | Site Map

VB questions in .NET env.

Newbie
 
Join Date: Oct 2008
Posts: 4
#1: Oct 29 '08
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.

Expand|Select|Wrap|Line Numbers
  1. </SCRIPT>
  2. var myLocation<%=""%>                  
  3. var myLocation<%=myI%>
  4. var ReportName<%=myI%> = "Time in System Report"
  5. var SQLStr<%=myI%> = escape("<%=SQLStr%>");
  6. myLocation<%=myI%>="rMetricXL.aspx?RiskTable=" + SQLStr<%=myI%> + "&ReportName=" + ReportName<%=myI%>
  7. </SCRIPT>
  8. <a HREF=myLocation<%=myI%><img src="images/excelreport2.gif" BORDER="0" alt="Excel version of home list"></a>

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Oct 29 '08

re: VB questions in .NET env.


What exactly are we looking at here?
It doesn't quite match the pattern of ASP.NET or html?
Newbie
 
Join Date: Oct 2008
Posts: 4
#3: Oct 29 '08

re: VB questions in .NET env.


Quote:

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.

Expand|Select|Wrap|Line Numbers
  1. <TR>
  2. <TD ALIGN="CENTER" COLSPAN="15">
  3. <SCRIPT>
  4. var myLocation<%=""%>  
  5. var myLocation<%=myI%>
  6. var ReportName<%=myI%> = "Time in System Report"
  7. var SQLStr<%=myI%> = escape("<%=SQLStr%>");
  8. myLocation<%=myI%>="rMetricXL.aspx?RiskTable=" + SQLStr<%=myI%> + "&ReportName=" + ReportName<%=myI%>
  9. </SCRIPT>
How can I translate the above script in the HREF so that a button is displayed and on click a report is generated.

Expand|Select|Wrap|Line Numbers
  1. <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>
  2. </TD>
  3. <%myI = myI + 1%>
  4.  </TR>
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Oct 30 '08

re: VB questions in .NET env.


Well you didn't name your <script> type, you should be including the type.
<script type="text/javascript" language="Javascript">
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?
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#5: Oct 30 '08

re: VB questions in .NET env.


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
Newbie
 
Join Date: Oct 2008
Posts: 4
#6: Oct 30 '08

re: VB questions in .NET env.


Quote:

Originally Posted by Plater

Well you didn't name your <script> type, you should be including the type.
<script type="text/javascript" language="Javascript">
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="Javascript"> 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.
insertAlias's Avatar
Forum Leader
 
Join Date: Apr 2008
Location: San Antonio, TX (USA)
Posts: 2,608
#7: Oct 30 '08

re: VB questions in .NET env.


Tell me, does the file end with .asp or .aspx?
Newbie
 
Join Date: Oct 2008
Posts: 4
#8: Oct 30 '08

re: VB questions in .NET env.


Quote:

Originally Posted by insertAlias

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

The file ends in aspx
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#9: Oct 30 '08

re: VB questions in .NET env.


Quote:

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.
Reply