Web表单上的文本框中出错 [英] Error in my Textbox on a web form

查看:80
本文介绍了Web表单上的文本框中出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我有一个网页表单,上面有水晶报表查看器,我也在表单中添加了一个文本框。当我运行表单时,我会在文本框中显示此文本。它说:System.Web.UI.WebControls.TextBox。为什么会这样?我使用文本框显示我想要确保它将显示我需要的会话ID。以下是该表格的代码。



Hello. I have a web form that has crystal report viewer on it and I added a textbox to the form also. When I run the form I get this text that appears in the textbox. It says this: "System.Web.UI.WebControls.TextBox". Why does this happen? I use the textbox to display the session ID that I want to make sure it will display what I need. Here is the code for that form.

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Web;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Xml.Linq;
using System.Web.SessionState;


namespace SACSCOCLogin1._1
{
    public partial class ReportFormA : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            TextBoxINST_ID.Text = Session["inst_id"].ToString();
            CrystalReportViewer1.Visible = true;
            //CrystalReportViewer1.Refresh();
            ReportDocument crystalReport = new ReportDocument();
            crystalReport.Load(Server.MapPath("~/Reports/ReportA.rpt"));
            crystalReport.SetDatabaseLogon
            ("Administrator", "losni", @"cocsql", "Password");
            CrystalReportViewer1.ReportSource = crystalReport;
            CrystalReportViewer1.SelectionFormula = "{TableCOCINST.LongName} = 'INST_ID' AND {TableCOCINST.STATE} = 'INST_ID' AND {TableCOCINST.CITY} = 'INST_ID'";
            //CrystalReportViewer1.SelectionFormula = "{TableFIN2013.inst_id} = '" + Session["inst_id"].ToString() + "'";
        }

推荐答案

我解决了!!我刚刚删除了crystalreportviewer并将Textbox添加到表单中,并将crystalreportviewer放在文本框下。没有错误。
I solved it!! I just removed the crystalreportviewer and added the Textbox to the form and put the crystalreportviewer under the textbox. No error.


这篇关于Web表单上的文本框中出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆