【发布时间】:2012-04-19 04:58:04
【问题描述】:
我正在尝试使用脚本管理器检查我的路径,我的代码在 App_Code 中,这是我的代码:
public ReportDocument ReportCon(string path)
{
ReportDocument cryRpt = new ReportDocument();
ConnectionInfo info = new ConnectionInfo();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
Tables CrTables;
info.ServerName = "192.168.1.200";
info.DatabaseName = "Track4L";
info.UserID = "Developers";
info.Password = "dev01@pps";
ScriptManager.RegisterStartupScript(this, typeof(Page), "test", "alert('" + path + "');", true);
cryRpt.Load(path);
CrTables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = info;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
return cryRpt;
}
但我收到以下错误:
Error The best overloaded method match for 'System.Web.UI.ScriptManager.RegisterStartupScript(System.Web.UI.Page, System.Type, string, string, bool)' has some invalid arguments D:\DMS\DocumentManagement\Track4L\App_Code\ReportConnection.cs 27 13 D:\...\Track4L\
不知道这个问题怎么解决
【问题讨论】:
-
只是猜测,但既然你说上面的代码在你的 App_Code 文件夹中,我敢打赌
this不是指System.Web.UI.Page。 -
@Tim 那么亲爱的我该做什么
-
按照@Adil 的建议去做。您需要更新代码中调用
ReportCon的所有位置,以获取Page参数和路径参数。
标签: c# asp.net-2.0 scriptmanager