Solved

JAVASCRIPT ERROR

Posted on 2004-10-19
13
462 Views
Last Modified: 2012-05-05
I need to be able to print with the javascript just  a silly string.

print.aspx


.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Drawing;
using System.Data.Common;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Data.Odbc;
namespace MSPOS
{
      /// <summary>
      /// Summary description for Receipts.
      /// </summary>
      public class Receipts : System.Web.UI.Page
      {
            protected System.Web.UI.WebControls.RadioButtonList Group_RadioButtonList;
            protected System.Web.UI.WebControls.DataGrid ReceiptsDataGrid;
            private DataSet ddlDataSet = new DataSet();
            private OdbcConnection myConnection =  new OdbcConnection("DSN=POS;UID=system;PWD=system");
            protected System.Web.UI.WebControls.Button btnRunQuery;
            protected System.Web.UI.WebControls.Button Button2;
            
            protected System.Web.UI.WebControls.TextBox txtPayment;
            protected System.Web.UI.WebControls.TextBox txtCashier;
            
            private DataSet ddlDataSet1 = new DataSet();
            private DataSet ddlDataSet2 = new DataSet();
            protected ActiveUp.WebControls.ActiveDateTime ActiveDateTime3;
            protected ActiveUp.WebControls.ActiveDateTime ActiveDateTime4;
            private DataSet ddlDataSet3 = new DataSet();
 
            private void Page_Load(object sender, System.EventArgs e)
            {
                  // Put user code to initialize the page here
                  if (!Page.IsPostBack)
                  {
                        ActiveDateTime3.Date = System.DateTime.Today.Date;
                        ActiveDateTime4.Date = System.DateTime.Today.Date;
                  }
            }

            #region Web Form Designer generated code
            override protected void OnInit(EventArgs e)
            {
                  //
                  // CODEGEN: This call is required by the ASP.NET Web Form Designer.
                  //
                  InitializeComponent();
                  base.OnInit(e);
            }
            
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {    
                  this.Group_RadioButtonList.SelectedIndexChanged += new System.EventHandler(this.Group_RadioButtonList_SelectedIndexChanged);
                  this.txtCashier.TextChanged += new System.EventHandler(this.txtCashier_TextChanged);
                  this.btnRunQuery.Click += new System.EventHandler(this.btnRunQuery_Click);
                  this.ReceiptsDataGrid.SelectedIndexChanged += new System.EventHandler(this.ReceiptsDataGrid_SelectedIndexChanged);
                  this.Load += new System.EventHandler(this.Page_Load);

            }
            #endregion

            public string DecodeReceipt (string szBill)
            {
                  string szNewBill="";
                             
                  // Create an ASCII encoding.
                  Encoding ascii = Encoding.ASCII;
                       
                  Byte[] encodedBytes = ascii.GetBytes(szBill);

                  foreach (Byte a in encodedBytes)
                  {
                        if ( a ==10 || a ==15 ||a==18 ||a ==27)
                        {}          
                        else if (a == 13)
                              szNewBill = szNewBill + "\\n";
                        else
                              szNewBill = szNewBill +(char) a;

                  }
                  return szNewBill;
            }
         


            private void txtPayment_TextChanged(object sender, System.EventArgs e)
            {
            
            }

            private void txtCashier_TextChanged(object sender, System.EventArgs e)
            {
            
            }

            //***********************************************************************
            // Get RC_PAYMND and populate dataset
            public DataSet BindRC_PAYMND(string searchstring)
            {
                  OdbcConnection myConnection =  new OdbcConnection("DSN=POS;UID=system;PWD=system");

                  // Populate the ddlDataSet1
                  myConnection.Open();
                  string strSQLDDL = @"SELECT RC_PAYMNB FROM TBRECEIPTS WHERE RC_PAYMNB='"+searchstring+"'";
                  OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
                  ddlDataSet1.Clear();  
                  myDataAdapter.Fill(ddlDataSet1, "ddlRC_PAYMNB");
                  myDataAdapter.Dispose();
                  myDataAdapter = null;
                  myConnection.Close();
                  strSQLDDL = null;
                  return ddlDataSet1;
            }
            //***********************************************************************

            //***********************************************************************
            // Get RC_CASHND and populate dataset
            public DataSet BindRC_CASHND(string searchstring)
            {
                  OdbcConnection myConnection =  new OdbcConnection("DSN=POS;UID=system;PWD=system");

                  // Populate the ddlDataSet2
                  myConnection.Open();
                  string strSQLDDL = @"SELECT RC_CASHNB FROM TBRECEIPTS WHERE RC_CASHNB='"+searchstring+"'";
                  OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
                  ddlDataSet2.Clear();  
                  myDataAdapter.Fill(ddlDataSet2, "ddlRC_CASHNB");
                  myDataAdapter.Dispose();
                  myDataAdapter = null;
                  myConnection.Close();
                  strSQLDDL = null;
                  return ddlDataSet2;
            }
            //***********************************************************************


            //***********************************************************************
            // Get RC_CASHND and populate dataset with RC_CASHND and RC_DATE
            public DataSet BindRC_DATE()
            {
                  OdbcConnection myConnection =  new OdbcConnection("DSN=POS;UID=system;PWD=system");

                  // Populate the ddlDataSet3
                  myConnection.Open();
                  string strSQLDDL = @"SELECT RC_DATE FROM TBRECEIPTS";
                  OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
                  ddlDataSet3.Clear();  
                  myDataAdapter.Fill(ddlDataSet3, "ddlRC_DATE");
                  myDataAdapter.Dispose();
                  myDataAdapter = null;
                  myConnection.Close();
                  strSQLDDL = null;
                  return ddlDataSet3;
            }
            //***********************************************************************
       
            public void ReceiptsDataGrid_ItemDataBound(object sender,System.Web.UI.WebControls.DataGridItemEventArgs e)
            {
                  if(e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType==ListItemType.Item )
                  {
                        string strValue="Javascript:OpenNewWin('"+ DecodeReceipt(e.Item.Cells[4].Text) + "');";
                        Button btn = ( (Button) e.Item.FindControl("Button2") );
                        btn.Attributes.Add("Onclick",strValue);

                  
                  }


            }
            //***********************************************************************
       


            public void ReceiptsDataGrid_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
            {
                  ListItemType oType = ((ListItemType)e.Item.ItemType);
                  if(oType == ListItemType.Item || oType == ListItemType.AlternatingItem)
                  {
                        e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='lightblue'");            
                        e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='Beige'");            
                  }
                  
                  if(e.CommandName =="View")
                  {
                        string parsedreceipt = null;
                        parsedreceipt = DecodeReceipt (e.Item.Cells[3].Text);
                        StringBuilder strAlert = new StringBuilder();
                        strAlert.Append("<script language=javascript> alert('");
                        strAlert.Append("Receipt:                    " + parsedreceipt + "\\n");
                        strAlert.Append("');</script>");
                        this.RegisterStartupScript("startup",strAlert.ToString());
                  }

                  
                  

            }


            private void Group_RadioButtonList_SelectedIndexChanged(object sender, System.EventArgs e)
            {
            
            }


            public void btnRunQuery_Click(object sender, System.EventArgs e)
            {
                  string select_statement = "SELECT RC_PAYMNB, RC_CASHNB, RC_DATE, RC_DATA FROM TBRECEIPTS";
                  string DateString1 = ActiveDateTime3.Date.Day.ToString() + "-" + ActiveDateTime3.Date.Month.ToString() + "-" + ActiveDateTime3.Date.Year.ToString();
                  string DateString2 = ActiveDateTime4.Date.Day.ToString() + "-" + ActiveDateTime4.Date.Month.ToString() + "-" + ActiveDateTime4.Date.Year.ToString();

                  
                  switch (Group_RadioButtonList.SelectedIndex)
                  {
                        case 0:
                              select_statement += " Where RC_PAYMNB='" + txtPayment.Text + "'";
                              break;
                        case 1:
                              select_statement += " Where RC_CASHNB='" + txtCashier.Text + "'";
                              break;
                        case 2:
                              select_statement += " Where To_Date(RC_DATE, 'dd-mm-yyyy') <= '" + DateString2.ToString() + "' And To_Date(RC_DATE, 'dd-mm-yyyy') >= '" + DateString1.ToString() + "'";
                              break;
                  }

            

                  OdbcConnection myConnection =  new
                  OdbcConnection("DSN=POS;UID=system;PWD=system");

                  // Populate the ddlDataSet1
                  myConnection.Open();
                  string strSQLDDL = select_statement;
                  OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL,myConnection);
                  ddlDataSet1.Clear();  
                  myDataAdapter.Fill(ddlDataSet1);
                  myDataAdapter.Dispose();
                  myDataAdapter = null;
                  myConnection.Close();
                  ReceiptsDataGrid.DataSource = ddlDataSet1.Tables[0];
                  ReceiptsDataGrid.DataBind();
            
        }

            private void ReceiptsDataGrid_SelectedIndexChanged(object sender, System.EventArgs e)
            {
            
            }
            

      }
}

.aspx

<%@ Register TagPrefix="mspos" TagName="footer" Src="~/Engine/Controls/footer.ascx" %>
<%@ Register TagPrefix="mspos" TagName="header" Src="Engine/Controls/header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="logout" Src="Engine/Controls/logout.ascx" %>
<%@ Page Language="c#" trace="true" Codebehind="Receipts.aspx.cs" AutoEventWireup="false" Inherits="MSPOS.Receipts" CompilerOptions='/R:"C:\Program Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"'%>
<%@ Register TagPrefix="cc1" Namespace="ActiveUp.WebControls" Assembly="ActiveDateTime" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
      <HEAD>
            <script language="javascript">
function OpenNewWin(Receipt)
{
     winNew = window.open("print.aspx?","printwindow","toolbar=no,scrollbar=no,height=200,width=300,resizable=no,top=200,left=200");
     var PrintHtml ="<Table cellpadding=5 cellspacing=5 broder=0>";
             PrintHtml = PrintHtml + "<TR><TD>Receipt</TD><TD width=5>:</TD><TD>" + Receipt + "</TD></TR>";
             PrintHtml = PrintHtml + " </TABLE>";
             PrintHtml = PrintHtml + " <DIV id=butPanel align=center> <input Type=button value='   Print  ' onclick=Javascript:document.getElementById('butPanel').style.display='none';window.print();document.getElementById('butPanel').style.display='';>";
             PrintHtml = PrintHtml + " <input type=button value=cancel onclick=javascript:window.close();></Div>";
             winNew.document.body.innerHTML=PrintHtml;
             winNew.focus();
}
            </script>
      </HEAD>
      <BODY leftMargin="0" background="images/bg.gif" topMargin="0">
            <form id="Form1" action="database.aspx" method="post" runat="server">
                  <strong>
                        <P><mspos:header id="Header1" runat="server"></mspos:header><BR>
                              <FONT face="Verdana" size="2"></FONT>
                        </P>
                        <P><FONT face="Verdana" size="2"></FONT>&nbsp;</P>
                        <FONT face="Verdana" size="2">
                              <P>
                                    <TABLE id="Table2" height="118" cellSpacing="1" cellPadding="1" width="355" border="0">
                                          <TR>
                                                <TD vAlign="top" width="147" colSpan="1" rowSpan="4">
                                                      <P><asp:radiobuttonlist id="Group_RadioButtonList" runat="server" BorderWidth="0px" CellSpacing="1" CellPadding="1"
                                                                  Height="111px" Font-Bold="True" Font-Size="12px" Font-Names="Verdana" Width="35px" BackColor="#FEF9E9">
                                                                  <asp:ListItem Value="PayNumber">1</asp:ListItem>
                                                                  <asp:ListItem Value="Cashier">2</asp:ListItem>
                                                                  <asp:ListItem Value="StartDate">3</asp:ListItem>
                                                            </asp:radiobuttonlist></P>
                                                      &nbsp;&nbsp;
                                                </TD>
                                                <TD noWrap colSpan="1" rowSpan="1">Payment Number:</TD>
                                                <TD vAlign="middle" noWrap width="200" colSpan="1" rowSpan="1"><asp:textbox id="txtPayment" runat="server" MaxLength="10"></asp:textbox></TD>
                                          </TR>
                                          <TR>
                                                <TD width="240">Cashier Number:</TD>
                                                <TD><asp:textbox id="txtCashier" runat="server" MaxLength="8"></asp:textbox></TD>
                                          </TR>
                                          <TR>
                                                <TD width="240" height="10">Start Date:</TD>
                                                <TD height="10"><cc1:activedatetime id="ActiveDateTime3" runat="server" AllowNull="False" MonthNamesDisabled="True"
                                                            Format="DAY;-;MONTH;-;YEAR"></cc1:activedatetime></TD>
                                          </TR>
                                          <TR>
                                                <TD width="240">End Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                </TD>
                                                <TD><cc1:activedatetime id="ActiveDateTime4" runat="server" AllowNull="False" MonthNamesDisabled="True"
                                                            Format="DAY;-;MONTH;-;YEAR"></cc1:activedatetime></TD>
                                          </TR>
                                          <TR>
                                                <TD width="240"></TD>
                                                <TD><asp:button id="btnRunQuery" onclick="btnRunQuery_Click" runat="server" text="Run Query" type="submit"></asp:button></TD>
                                          </TR>
                                    </TABLE>
                        </FONT></strong>
                  <br>
                  <strong>Results of:</strong>
                  <asp:datagrid id="ReceiptsDataGrid" runat="server" BorderWidth="3" CellSpacing="1" CellPadding="1"
                        Height="144px" Width="500px" OnItemDataBound="ReceiptsDataGrid_ItemDataBound" OnItemCommand="ReceiptsDataGrid_ItemCommand"
                        HeaderStyle-Font-Bold="True" maintainviewstate="false" GridLines="None" BorderStyle="Outset"
                        font-size="XX-Small" font-names="Verdana" BorderColor="#CCCC99" AutoGenerateColumns="False">
                        <AlternatingItemStyle Wrap="False" BackColor="PaleGoldenrod"></AlternatingItemStyle>
                        <ItemStyle Wrap="False" BackColor="Beige"></ItemStyle>
                        <HeaderStyle Font-Size="14px" Font-Bold="True" ForeColor="White" BackColor="#954896"></HeaderStyle>
                        <Columns>
                              <asp:BoundColumn DataField="RC_PAYMNB" HeaderText="Payment Number "></asp:BoundColumn>
                              <asp:BoundColumn DataField="RC_CASHNB" HeaderText="Cash Number"></asp:BoundColumn>
                              <asp:BoundColumn DataField="RC_DATE" HeaderText="Date"></asp:BoundColumn>
                              <asp:BoundColumn DataField="RC_DATA" Visible="False" HeaderText="Data"></asp:BoundColumn>
                              <asp:TemplateColumn>
                                    <ItemTemplate>
                                          <asp:Button CommandName="View" Text="View" Runat="server" ID="Button1"></asp:Button>
                                    </ItemTemplate>
                              </asp:TemplateColumn>
                              <asp:TemplateColumn>
                                    <ItemTemplate>
                                          <asp:Button CommandName="Print" Text="Print" Runat="server" ID="Button2"></asp:Button>
                                    </ItemTemplate>
                              </asp:TemplateColumn>
                        </Columns>
                  </asp:datagrid></P></form>
      </BODY>
</HTML>
0
Comment
Question by:mathieu_cupryk
  • 6
  • 4
  • 3
13 Comments
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Hi mathieu_cupryk,

What's the error say?

Regards,
Zyloch
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
Server Error in '/MSPOS' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30311: Value of type 'System.Web.SessionState.HttpSessionState' cannot be converted to 'String'.

Source Error:

 

Line 12:           marginwidth="0" marginheight="0" onLoad="window.print();">
Line 13:           <FORM id="Form1" method="post" runat="server">
Line 14:           <%= Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>")%>
Line 15:           </FORM>
Line 16:       </BODY>
 

Source File: C:\Inetpub\wwwroot\MSPOS\print.aspx    Line: 14



Show Detailed Compiler Output:


c:\windows\system32\inetsrv> "c:\windows\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\assembly\dl2\18b8a94a\4e887d3b_0eb5c401\activedatetime.dll" /R:"c:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\assembly\dl2\412fda75\cee21c7f_31b6c401\mspos.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\7w8ukhzc.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\oydwmfwq.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\oydwmfwq.res"  "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\oydwmfwq.0.vb"


Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Inetpub\wwwroot\MSPOS\print.aspx(14) : error BC30311: Value of type 'System.Web.SessionState.HttpSessionState' cannot be converted to 'String'.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
                                             ~~~~~~~                                                    
C:\Inetpub\wwwroot\MSPOS\print.aspx(14) : error BC30203: Identifier expected.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
                                                     ~~~~~~~~~~~~~~~                                    
C:\Inetpub\wwwroot\MSPOS\print.aspx(14) : error BC30205: End of statement expected.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
                                                                                                        ~

 



Show Complete Compilation Source:


Line 1:    '------------------------------------------------------------------------------
Line 2:    ' <autogenerated>
Line 3:    '     This code was generated by a tool.
Line 4:    '     Runtime Version: 1.1.4322.2032
Line 5:    '
Line 6:    '     Changes to this file may cause incorrect behavior and will be lost if
Line 7:    '     the code is regenerated.
Line 8:    ' </autogenerated>
Line 9:    '------------------------------------------------------------------------------
Line 10:  
Line 11:   Option Strict Off
Line 12:   Option Explicit On
Line 13:  
Line 14:   Imports ASP
Line 15:   Imports Microsoft.VisualBasic
Line 16:   Imports System
Line 17:   Imports System.Collections
Line 18:   Imports System.Collections.Specialized
Line 19:   Imports System.Configuration
Line 20:   Imports System.Text
Line 21:   Imports System.Text.RegularExpressions
Line 22:   Imports System.Web
Line 23:   Imports System.Web.Caching
Line 24:   Imports System.Web.Security
Line 25:   Imports System.Web.SessionState
Line 26:   Imports System.Web.UI
Line 27:   Imports System.Web.UI.HtmlControls
Line 28:   Imports System.Web.UI.WebControls
Line 29:  
Line 30:   Namespace ASP
Line 31:      
Line 32:       <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()>  _
Line 33:       Public Class print_aspx
Line 34:           Inherits System.Web.UI.Page
Line 35:           Implements System.Web.SessionState.IRequiresSessionState
Line 36:          
Line 37:          
Line 38:           #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",13)
Line 39:           Protected Form1 As System.Web.UI.HtmlControls.HtmlForm
Line 40:          
Line 41:           #End ExternalSource
Line 42:          
Line 43:           Private Shared __initialized As Boolean = false
Line 44:          
Line 45:           Private Shared __stringResource As Object
Line 46:          
Line 47:           Private Shared __fileDependencies As System.Collections.ArrayList
Line 48:          
Line 49:           Public Sub New()
Line 50:               MyBase.New
Line 51:               Dim dependencies As System.Collections.ArrayList
Line 52:               If (ASP.print_aspx.__initialized = false) Then
Line 53:                   ASP.print_aspx.__stringResource = System.Web.UI.TemplateControl.ReadStringResource(GetType(ASP.print_aspx))
Line 54:                   dependencies = New System.Collections.ArrayList
Line 55:                   dependencies.Add("C:\Inetpub\wwwroot\MSPOS\print.aspx")
Line 56:                   ASP.print_aspx.__fileDependencies = dependencies
Line 57:                   ASP.print_aspx.__initialized = true
Line 58:               End If
Line 59:               Me.Server.ScriptTimeout = 30000000
Line 60:           End Sub
Line 61:          
Line 62:           Protected Overrides ReadOnly Property SupportAutoEvents As Boolean
Line 63:               Get
Line 64:                   Return false
Line 65:               End Get
Line 66:           End Property
Line 67:          
Line 68:           Protected ReadOnly Property ApplicationInstance As ASP.Global_asax
Line 69:               Get
Line 70:                   Return CType(Me.Context.ApplicationInstance,ASP.Global_asax)
Line 71:               End Get
Line 72:           End Property
Line 73:          
Line 74:           Public Overrides ReadOnly Property TemplateSourceDirectory As String
Line 75:               Get
Line 76:                   Return "/MSPOS"
Line 77:               End Get
Line 78:           End Property
Line 79:          
Line 80:           Private Function __BuildControlForm1() As System.Web.UI.Control
Line 81:               Dim __ctrl As System.Web.UI.HtmlControls.HtmlForm
Line 82:              
Line 83:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",13)
Line 84:               __ctrl = New System.Web.UI.HtmlControls.HtmlForm
Line 85:              
Line 86:               #End ExternalSource
Line 87:               Me.Form1 = __ctrl
Line 88:              
Line 89:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",13)
Line 90:               __ctrl.ID = "Form1"
Line 91:              
Line 92:               #End ExternalSource
Line 93:              
Line 94:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",13)
Line 95:               __ctrl.Method = "post"
Line 96:              
Line 97:               #End ExternalSource
Line 98:               __ctrl.SetRenderMethodDelegate(AddressOf Me.__RenderForm1)
Line 99:               Return __ctrl
Line 100:          End Function
Line 101:          
Line 102:          Private Sub __RenderForm1(ByVal __output As System.Web.UI.HtmlTextWriter, ByVal parameterContainer As System.Web.UI.Control)
Line 103:              __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"          ")
Line 104:              
Line 105:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",14)
Line 106:              __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
Line 107:              
Line 108:              #End ExternalSource
Line 109:              __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"          ")
Line 110:          End Sub
Line 111:          
Line 112:          Private Sub __BuildControlTree(ByVal __ctrl As System.Web.UI.Control)
Line 113:              Dim __parser As System.Web.UI.IParserAccessor = CType(__ctrl,System.Web.UI.IParserAccessor)
Line 114:              
Line 115:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 116:              __parser.AddParsedSubObject(Me.CreateResourceBasedLiteralControl(0, 609, true))
Line 117:              
Line 118:              #End ExternalSource
Line 119:              
Line 120:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 121:              Me.__BuildControlForm1
Line 122:              
Line 123:              #End ExternalSource
Line 124:              
Line 125:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 126:              __parser.AddParsedSubObject(Me.Form1)
Line 127:              
Line 128:              #End ExternalSource
Line 129:              
Line 130:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 131:              __parser.AddParsedSubObject(New System.Web.UI.LiteralControl(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"      </BODY>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"  </HTML>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)))
Line 132:              
Line 133:              #End ExternalSource
Line 134:          End Sub
Line 135:          
Line 136:          Protected Overrides Sub FrameworkInitialize()
Line 137:              SetStringResourcePointer(ASP.print_aspx.__stringResource, 609)
Line 138:              Me.__BuildControlTree(Me)
Line 139:              Me.FileDependencies = ASP.print_aspx.__fileDependencies
Line 140:              Me.EnableViewStateMac = true
Line 141:              Me.Request.ValidateInput
Line 142:          End Sub
Line 143:          
Line 144:          Public Overrides Function GetTypeHashCode() As Integer
Line 145:              Return -2025760662
Line 146:          End Function
Line 147:      End Class
Line 148:  End Namespace
Line 149:  
 




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
Server Error in '/MSPOS' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30311: Value of type 'System.Web.SessionState.HttpSessionState' cannot be converted to 'String'.

Source Error:

 

Line 19:           marginwidth="0" marginheight="0" onLoad="window.print();">
Line 20:           <FORM id="Form1" method="post" runat="server">
Line 21:           <%= Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>")%>
Line 22:           </FORM>
Line 23:       </BODY>
 

Source File: C:\Inetpub\wwwroot\MSPOS\print.aspx    Line: 21



Show Detailed Compiler Output:


c:\windows\system32\inetsrv> "c:\windows\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\assembly\dl2\412fda75\3ab4297d_34b6c401\mspos.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\xm06i4zk.dll" /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\assembly\dl2\18b8a94a\4e887d3b_0eb5c401\activedatetime.dll" /R:"c:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\bhtpdywc.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\bhtpdywc.res"  "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\bhtpdywc.0.vb"


Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Inetpub\wwwroot\MSPOS\print.aspx(21) : error BC30311: Value of type 'System.Web.SessionState.HttpSessionState' cannot be converted to 'String'.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
                                             ~~~~~~~                                                    
C:\Inetpub\wwwroot\MSPOS\print.aspx(21) : error BC30203: Identifier expected.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
                                                     ~~~~~~~~~~~~~~~                                    
C:\Inetpub\wwwroot\MSPOS\print.aspx(21) : error BC30205: End of statement expected.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
                                                                                                        ~

 



Show Complete Compilation Source:


Line 1:    '------------------------------------------------------------------------------
Line 2:    ' <autogenerated>
Line 3:    '     This code was generated by a tool.
Line 4:    '     Runtime Version: 1.1.4322.2032
Line 5:    '
Line 6:    '     Changes to this file may cause incorrect behavior and will be lost if
Line 7:    '     the code is regenerated.
Line 8:    ' </autogenerated>
Line 9:    '------------------------------------------------------------------------------
Line 10:  
Line 11:   Option Strict Off
Line 12:   Option Explicit On
Line 13:  
Line 14:   Imports ASP
Line 15:   Imports Microsoft.VisualBasic
Line 16:   Imports System
Line 17:   Imports System.Collections
Line 18:   Imports System.Collections.Specialized
Line 19:   Imports System.ComponentModel
Line 20:   Imports System.Configuration
Line 21:   Imports System.Data
Line 22:   Imports System.Drawing
Line 23:   Imports System.Text
Line 24:   Imports System.Text.RegularExpressions
Line 25:   Imports System.Web
Line 26:   Imports System.Web.Caching
Line 27:   Imports System.Web.Security
Line 28:   Imports System.Web.SessionState
Line 29:   Imports System.Web.UI
Line 30:   Imports System.Web.UI.HtmlControls
Line 31:   Imports System.Web.UI.WebControls
Line 32:  
Line 33:   Namespace ASP
Line 34:      
Line 35:       <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()>  _
Line 36:       Public Class print_aspx
Line 37:           Inherits System.Web.UI.Page
Line 38:           Implements System.Web.SessionState.IRequiresSessionState
Line 39:          
Line 40:          
Line 41:           #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 42:           Protected Form1 As System.Web.UI.HtmlControls.HtmlForm
Line 43:          
Line 44:           #End ExternalSource
Line 45:          
Line 46:           Private Shared __initialized As Boolean = false
Line 47:          
Line 48:           Private Shared __stringResource As Object
Line 49:          
Line 50:           Private Shared __fileDependencies As System.Collections.ArrayList
Line 51:          
Line 52:           Public Sub New()
Line 53:               MyBase.New
Line 54:               Dim dependencies As System.Collections.ArrayList
Line 55:               If (ASP.print_aspx.__initialized = false) Then
Line 56:                   ASP.print_aspx.__stringResource = System.Web.UI.TemplateControl.ReadStringResource(GetType(ASP.print_aspx))
Line 57:                   dependencies = New System.Collections.ArrayList
Line 58:                   dependencies.Add("C:\Inetpub\wwwroot\MSPOS\print.aspx")
Line 59:                   ASP.print_aspx.__fileDependencies = dependencies
Line 60:                   ASP.print_aspx.__initialized = true
Line 61:               End If
Line 62:               Me.Server.ScriptTimeout = 30000000
Line 63:           End Sub
Line 64:          
Line 65:           Protected Overrides ReadOnly Property SupportAutoEvents As Boolean
Line 66:               Get
Line 67:                   Return false
Line 68:               End Get
Line 69:           End Property
Line 70:          
Line 71:           Protected ReadOnly Property ApplicationInstance As ASP.Global_asax
Line 72:               Get
Line 73:                   Return CType(Me.Context.ApplicationInstance,ASP.Global_asax)
Line 74:               End Get
Line 75:           End Property
Line 76:          
Line 77:           Public Overrides ReadOnly Property TemplateSourceDirectory As String
Line 78:               Get
Line 79:                   Return "/MSPOS"
Line 80:               End Get
Line 81:           End Property
Line 82:          
Line 83:           Private Function __BuildControlForm1() As System.Web.UI.Control
Line 84:               Dim __ctrl As System.Web.UI.HtmlControls.HtmlForm
Line 85:              
Line 86:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 87:               __ctrl = New System.Web.UI.HtmlControls.HtmlForm
Line 88:              
Line 89:               #End ExternalSource
Line 90:               Me.Form1 = __ctrl
Line 91:              
Line 92:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 93:               __ctrl.ID = "Form1"
Line 94:              
Line 95:               #End ExternalSource
Line 96:              
Line 97:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 98:               __ctrl.Method = "post"
Line 99:              
Line 100:              #End ExternalSource
Line 101:              __ctrl.SetRenderMethodDelegate(AddressOf Me.__RenderForm1)
Line 102:              Return __ctrl
Line 103:          End Function
Line 104:          
Line 105:          Private Sub __RenderForm1(ByVal __output As System.Web.UI.HtmlTextWriter, ByVal parameterContainer As System.Web.UI.Control)
Line 106:              __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"          ")
Line 107:              
Line 108:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",21)
Line 109:              __output.Write(Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>"))
Line 110:              
Line 111:              #End ExternalSource
Line 112:              __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"          ")
Line 113:          End Sub
Line 114:          
Line 115:          Private Sub __BuildControlTree(ByVal __ctrl As System.Web.UI.Control)
Line 116:              Dim __parser As System.Web.UI.IParserAccessor = CType(__ctrl,System.Web.UI.IParserAccessor)
Line 117:              
Line 118:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 119:              __parser.AddParsedSubObject(Me.CreateResourceBasedLiteralControl(0, 544, true))
Line 120:              
Line 121:              #End ExternalSource
Line 122:              
Line 123:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 124:              Me.__BuildControlForm1
Line 125:              
Line 126:              #End ExternalSource
Line 127:              
Line 128:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 129:              __parser.AddParsedSubObject(Me.Form1)
Line 130:              
Line 131:              #End ExternalSource
Line 132:              
Line 133:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 134:              __parser.AddParsedSubObject(New System.Web.UI.LiteralControl(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"      </BODY>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"  </HTML>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)))
Line 135:              
Line 136:              #End ExternalSource
Line 137:          End Sub
Line 138:          
Line 139:          Protected Overrides Sub FrameworkInitialize()
Line 140:              SetStringResourcePointer(ASP.print_aspx.__stringResource, 544)
Line 141:              Me.__BuildControlTree(Me)
Line 142:              Me.FileDependencies = ASP.print_aspx.__fileDependencies
Line 143:              Me.EnableViewStateMac = true
Line 144:              Me.Request.ValidateInput
Line 145:          End Sub
Line 146:          
Line 147:          Public Overrides Function GetTypeHashCode() As Integer
Line 148:              Return -2025760662
Line 149:          End Function
Line 150:      End Class
Line 151:  End Namespace
Line 152:  
 




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Seems this line is in error:

Server.HtmlEncode(Session["parsedreceipt"].ToString()).Replace("\\n", "<BR>")

Try this:

Server.HtmlEncode(Session["parsedreceipt"]).Replace("\\n", "<BR>")
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
Server Error in '/MSPOS' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30311: Value of type 'System.Web.SessionState.HttpSessionState' cannot be converted to 'String'.

Source Error:

 

Line 19:           marginwidth="0" marginheight="0" onLoad="window.print();">
Line 20:           <FORM id="Form1" method="post" runat="server">
Line 21:           <%=Server.HtmlEncode(Session["parsedreceipt"]).Replace("\\n", "<BR>")%>
Line 22:           </FORM>
Line 23:       </BODY>
 

Source File: C:\Inetpub\wwwroot\MSPOS\print.aspx    Line: 21



Show Detailed Compiler Output:


c:\windows\system32\inetsrv> "c:\windows\microsoft.net\framework\v1.1.4322\vbc.exe" /t:library /utf8output /R:"c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\assembly\dl2\18b8a94a\4e887d3b_0eb5c401\activedatetime.dll" /R:"c:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\windows\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\assembly\dl2\412fda75\dcf8c71f_35b6c401\mspos.dll" /R:"c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\mspos\103692e3\19bdc9e7\qipjngsx.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\ky2sx4tt.dll" /D:DEBUG=1 /debug+ /win32resource:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\ky2sx4tt.res"  "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mspos\103692e3\19bdc9e7\ky2sx4tt.0.vb"


Microsoft (R) Visual Basic .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322.2032
Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.

C:\Inetpub\wwwroot\MSPOS\print.aspx(21) : error BC30311: Value of type 'System.Web.SessionState.HttpSessionState' cannot be converted to 'String'.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"]).Replace("\\n", "<BR>"))
                                             ~~~~~~~                                          
C:\Inetpub\wwwroot\MSPOS\print.aspx(21) : error BC30203: Identifier expected.

            __output.Write(Server.HtmlEncode(Session["parsedreceipt"]).Replace("\\n", "<BR>"))
                                                     ~~~~~~~~~~~~~~~                          

 



Show Complete Compilation Source:


Line 1:    '------------------------------------------------------------------------------
Line 2:    ' <autogenerated>
Line 3:    '     This code was generated by a tool.
Line 4:    '     Runtime Version: 1.1.4322.2032
Line 5:    '
Line 6:    '     Changes to this file may cause incorrect behavior and will be lost if
Line 7:    '     the code is regenerated.
Line 8:    ' </autogenerated>
Line 9:    '------------------------------------------------------------------------------
Line 10:  
Line 11:   Option Strict Off
Line 12:   Option Explicit On
Line 13:  
Line 14:   Imports ASP
Line 15:   Imports Microsoft.VisualBasic
Line 16:   Imports System
Line 17:   Imports System.Collections
Line 18:   Imports System.Collections.Specialized
Line 19:   Imports System.ComponentModel
Line 20:   Imports System.Configuration
Line 21:   Imports System.Data
Line 22:   Imports System.Drawing
Line 23:   Imports System.Text
Line 24:   Imports System.Text.RegularExpressions
Line 25:   Imports System.Web
Line 26:   Imports System.Web.Caching
Line 27:   Imports System.Web.Security
Line 28:   Imports System.Web.SessionState
Line 29:   Imports System.Web.UI
Line 30:   Imports System.Web.UI.HtmlControls
Line 31:   Imports System.Web.UI.WebControls
Line 32:  
Line 33:   Namespace ASP
Line 34:      
Line 35:       <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()>  _
Line 36:       Public Class print_aspx
Line 37:           Inherits System.Web.UI.Page
Line 38:           Implements System.Web.SessionState.IRequiresSessionState
Line 39:          
Line 40:          
Line 41:           #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 42:           Protected Form1 As System.Web.UI.HtmlControls.HtmlForm
Line 43:          
Line 44:           #End ExternalSource
Line 45:          
Line 46:           Private Shared __initialized As Boolean = false
Line 47:          
Line 48:           Private Shared __stringResource As Object
Line 49:          
Line 50:           Private Shared __fileDependencies As System.Collections.ArrayList
Line 51:          
Line 52:           Public Sub New()
Line 53:               MyBase.New
Line 54:               Dim dependencies As System.Collections.ArrayList
Line 55:               If (ASP.print_aspx.__initialized = false) Then
Line 56:                   ASP.print_aspx.__stringResource = System.Web.UI.TemplateControl.ReadStringResource(GetType(ASP.print_aspx))
Line 57:                   dependencies = New System.Collections.ArrayList
Line 58:                   dependencies.Add("C:\Inetpub\wwwroot\MSPOS\print.aspx")
Line 59:                   ASP.print_aspx.__fileDependencies = dependencies
Line 60:                   ASP.print_aspx.__initialized = true
Line 61:               End If
Line 62:               Me.Server.ScriptTimeout = 30000000
Line 63:           End Sub
Line 64:          
Line 65:           Protected Overrides ReadOnly Property SupportAutoEvents As Boolean
Line 66:               Get
Line 67:                   Return false
Line 68:               End Get
Line 69:           End Property
Line 70:          
Line 71:           Protected ReadOnly Property ApplicationInstance As ASP.Global_asax
Line 72:               Get
Line 73:                   Return CType(Me.Context.ApplicationInstance,ASP.Global_asax)
Line 74:               End Get
Line 75:           End Property
Line 76:          
Line 77:           Public Overrides ReadOnly Property TemplateSourceDirectory As String
Line 78:               Get
Line 79:                   Return "/MSPOS"
Line 80:               End Get
Line 81:           End Property
Line 82:          
Line 83:           Private Function __BuildControlForm1() As System.Web.UI.Control
Line 84:               Dim __ctrl As System.Web.UI.HtmlControls.HtmlForm
Line 85:              
Line 86:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 87:               __ctrl = New System.Web.UI.HtmlControls.HtmlForm
Line 88:              
Line 89:               #End ExternalSource
Line 90:               Me.Form1 = __ctrl
Line 91:              
Line 92:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 93:               __ctrl.ID = "Form1"
Line 94:              
Line 95:               #End ExternalSource
Line 96:              
Line 97:               #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",20)
Line 98:               __ctrl.Method = "post"
Line 99:              
Line 100:              #End ExternalSource
Line 101:              __ctrl.SetRenderMethodDelegate(AddressOf Me.__RenderForm1)
Line 102:              Return __ctrl
Line 103:          End Function
Line 104:          
Line 105:          Private Sub __RenderForm1(ByVal __output As System.Web.UI.HtmlTextWriter, ByVal parameterContainer As System.Web.UI.Control)
Line 106:              __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"          ")
Line 107:              
Line 108:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",21)
Line 109:              __output.Write(Server.HtmlEncode(Session["parsedreceipt"]).Replace("\\n", "<BR>"))
Line 110:              
Line 111:              #End ExternalSource
Line 112:              __output.Write(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"          ")
Line 113:          End Sub
Line 114:          
Line 115:          Private Sub __BuildControlTree(ByVal __ctrl As System.Web.UI.Control)
Line 116:              Dim __parser As System.Web.UI.IParserAccessor = CType(__ctrl,System.Web.UI.IParserAccessor)
Line 117:              
Line 118:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 119:              __parser.AddParsedSubObject(Me.CreateResourceBasedLiteralControl(0, 544, true))
Line 120:              
Line 121:              #End ExternalSource
Line 122:              
Line 123:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 124:              Me.__BuildControlForm1
Line 125:              
Line 126:              #End ExternalSource
Line 127:              
Line 128:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 129:              __parser.AddParsedSubObject(Me.Form1)
Line 130:              
Line 131:              #End ExternalSource
Line 132:              
Line 133:              #ExternalSource("C:\Inetpub\wwwroot\MSPOS\print.aspx",1)
Line 134:              __parser.AddParsedSubObject(New System.Web.UI.LiteralControl(""&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"      </BODY>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)&"  </HTML>"&Microsoft.VisualBasic.ChrW(13)&Microsoft.VisualBasic.ChrW(10)))
Line 135:              
Line 136:              #End ExternalSource
Line 137:          End Sub
Line 138:          
Line 139:          Protected Overrides Sub FrameworkInitialize()
Line 140:              SetStringResourcePointer(ASP.print_aspx.__stringResource, 544)
Line 141:              Me.__BuildControlTree(Me)
Line 142:              Me.FileDependencies = ASP.print_aspx.__fileDependencies
Line 143:              Me.EnableViewStateMac = true
Line 144:              Me.Request.ValidateInput
Line 145:          End Sub
Line 146:          
Line 147:          Public Overrides Function GetTypeHashCode() As Integer
Line 148:              Return -2025760662
Line 149:          End Function
Line 150:      End Class
Line 151:  End Namespace
Line 152:  
 




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Sorry, ASP isn't my strongest language. Um... try this:

<%=Server.HtmlEncode(Session("parsedreceipt")).Replace("\\n", "<BR>")%>
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:mathieu_cupryk
Comment Utility
Ah man this is VB
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Ah, I see... hmm... but I'm still pretty sure Sessions you use parentheses and not brackets in VB/ASP
0
 
LVL 6

Expert Comment

by:ryerras
Comment Utility
<%= Server.HtmlEncode(Session("parsedreceipt").ToString()).Replace("\\n", "<BR>")%>

as Zyloch said, Session in vb.net is parenthesis, not square brackets, so try with parenthesis as above,
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
I am using C#
0
 
LVL 6

Expert Comment

by:ryerras
Comment Utility
hmm. Then you posted the wrong code in this thread
0
 

Author Comment

by:mathieu_cupryk
Comment Utility
ASP.NET (C#)
0
 
LVL 6

Accepted Solution

by:
ryerras earned 500 total points
Comment Utility
Ok. I know when you say C# and web app, its  asp.net with C#. But the code you posted in this thread, where you mentioned you are getting error, is not in C#. If you scroll up and see, you would notice that, probably its not code you intended to post here while referring to the error
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now