[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 594
  • Last Modified:

Displaying text variable in ASPX file

I have no experience using ASP.NET and neither do any of the people I work with. I've inherited an old ASPX program from a programmer that moved on years ago. If you search the code below for the last instance of the variable TextToUse (near the bottom) , you will see that I had hoped that  <%=TextToUse% would display the string that has been assigned to this variable. In fact, it generates an error. If I remove this one snippet of code, the file works fine. How can I get this file to display the contents of this variable at this point in the code?  Thanks.
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Progress.aspx.vb" Inherits="Progress.WebForm1"%>
<%	
Dim WhichText As String
Dim TextToUse As String
WhichText=Request.QueryString("new_window")
       Select case WhichText
             Case ""
             TextToUse="Once you've downloaded the file, please click the Browser's Back button and then select another menu option."
			 Case "N"
             TextToUse="Once you've downloaded the file, please click the Browser's Back button and then select another menu option."
             Case "Y"
             TextToUse="If the previous message that you saw indicated that your report can all be printed in one file, close this window after you have downloaded your file. You can then proceed to change your crosstab selections and generate another report of the same type or you can select another option from EIM's menu.  If, however, the message that appeared told you that your report exceeds the maximum number of 256 columns, you must first close this window before you follow the instructions to select the same menu option aain to generate the remainder of your report."
       end select
 
 
%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<meta http-equiv=Refresh content="<%# RefreshSeconds %>">
	</HEAD>
	<body bgColor="#edebea" MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<asp:table id="Table1" style="Z-INDEX: 101; LEFT: 100px; POSITION: absolute; TOP: 72px" runat="server"
				BackColor="#E0E0E0" BorderWidth="0px" BorderColor="#E0E0E0" BorderStyle="None" Height="24px"
				Width="760px">
				<asp:TableRow BorderWidth="0px" BorderColor="#0000C0" BorderStyle="Solid" BackColor="White">
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
					<asp:TableCell BackColor="#E0E0E0" ForeColor="#E0E0E0" BorderColor="#E0E0E0"></asp:TableCell>
				</asp:TableRow>
			</asp:table><asp:label id="Label1" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute; TOP: 16px" runat="server"
				Height="32px" Width="716px" Font-Size="X-Large" Font-Names="Verdana">Creating Your Requested File</asp:label>
  		   	<asp:label id="Label2" style="Z-INDEX: 103; LEFT: 100px; POSITION: absolute; TOP: 128px" runat="server" 
				Height="96px" Width="800px" Font-Size="Medium" Font-Names="Verdana" Visible="False"><%=TextToUse%></asp:label>
			<asp:Button id="Button1" style="Z-INDEX: 104; LEFT: 224px; POSITION: absolute; TOP: 224px" runat="server"
				Height="48px" Width="504px" Font-Names="Verdana" Visible="False" Text="Your file is complete.  Click here to Download it."
				Font-Bold="True" BackColor="Silver"></asp:Button></form>
	</body>
</HTML>

Open in new window

0
gregbuckle
Asked:
gregbuckle
1 Solution
 
Juan_BarreraCommented:
Hi, try this:

- Remove the <%=TextToUse%> part from the Label.
- In code behind, after the "end select" line, enter Label2.Text = TextToUse

That should be all.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now