我試圖檢查使用腳本管理我的路,我的代碼是在App_Code文件這裏是我的代碼:ScriptManager在我的代碼錯誤?
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 = "[email protected]";
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;
}
,但我得到以下錯誤「錯誤「的System.Web.UI的最佳重載的方法匹配。 ScriptManager.RegisterStartupScript(System.Web.UI.Page,System.Type,string,string,bool)'有一些無效參數D:\ DMS \ DocumentManagement \ Track4L \ App_Code \ ReportConnection.cs 27 13 D:... \ Track4L \」
我不知道這個問題怎麼會solved.tell我什麼在我的代碼是問題
只是一個猜測,但既然你說上面的代碼是在你的App_Code文件夾,我打賭'this'並不是指一個'System.Web.UI.Page'。 – Tim 2012-04-19 05:03:51
@Tim然後我必須做的親愛的 – 2012-04-19 05:14:04
做什麼@Adil推薦。您需要更新代碼中的所有位置,其中'ReportCon'被調用以獲取'Page'參數和路徑參數。 – Tim 2012-04-19 05:15:20