Tag: asp.net

TuesPechkin无法加载DLL’wkhtmltox.dll’

我一直在使用TuesPechkin已经有一段时间了今天我将nuget包更新到新版本2.0.0+并注意到Factory.Create()不再解决了,所以我去了GitHub阅读所做的更改并注意到它现在期望到dll的路径? IConverter converter = new ThreadSafeConverter( new PdfToolset( new StaticDeployment(DLL_FOLDER_PATH))); 在过去的几个小时里,我已经尝试了几乎所有我能想到的路径,“\ bin”,“\ app_data”,“\ app_start”等,我似乎无法找到或弄清楚它想要什么路径和什么DLL? 我可以在我的bin文件夹中看到TuesPechkin dll,这是我尝试的第一条路径,但是我收到以下错误: 其他信息:无法加载DLL’wkhtmltox.dll’:找不到指定的模块。 (HRESULTexception:0x8007007E) 那个dll在哪里,现在我可以得到它,因为库似乎不包含它,我尝试安装TuesPechkin.Wkhtmltox.Win32包,但dll仍然无处可寻。 另外我在asp.net网站项目中使用它,所以我假设使用以下内容应该可以用于获取路径,对吧? var path = HttpContext.Current.Server.MapPath(@”~\bin\TuesPechkin.dll”); 更多信息: https : //github.com/tuespetre/TuesPechkin/issues/57

在后面的代码中获取javascript中设置的值

我在html中有以下内容 我在javascript中有以下内容 function GetValues() { // for (i = 1; i <= 5; i++) // { // $("#hdnTableValues")[0].value += document.getElementById("txtSerialNo_1").value+ ","; // $("#hdnTableValues")[0].value += document.getElementById("txtBookName_1").value + ","; // $("#hdnTableValues")[0].value += document.getElementById("txtAuthor_1").value + ","; // $("#hdnTableValues")[0].value += document.getElementById("txtPublisher_1").value + ","; // $("#hdnTableValues")[0].value += document.getElementById("txtNoOfBooks_1").value + ","; // $("#hdnTableValues")[0].value += document.getElementById("txtRemarks_1").value + "|"; // // } document.getElementById("lblTableValues").innerHTML […]

为什么ResourceManager.GetResourceSet在构建后的第一个请求上返回null? (C#)

我正在研究一个用C#(asp.net)构建的大型Web应用程序。 我有一个简单的aspx页面,它为客户端浏览器提供本地化字符串,以便在javascript控件中使用。 为了获得字符串,我执行以下操作: ResourceManager _resources = new ResourceManager(_pathname, typeof(ARM).Assembly); ResourceSet rs = _resources.GetResourceSet(culture, false, false); //loop through rs and write the keys & values out to the client in plaintext 这一切都很好,除了在Clean / Build或Rebuild之后立即对页面的第一个请求(如果我只是进行一些更改,然后Build,它工作正常)。 所以在第一个请求时,当我尝试迭代ResourceSet时,我得到一个空引用exception。 但是,如果我在错误之后刷新页面,那么它从那时起就可以正常工作。 有谁知道为什么会这样?

我如何使用Profilebase类?

我尝试使用asp.net配置文件,我尝试使用ProfileBaseinheritance public class dort_islem : ProfileBase { public int ilk_sayi { get; set; } public int ikinci_sayi { get; set; } } 但如果我尝试使用这些代码Default.aspx: alt text http://sofzh.miximages.com/c%23/zn5v60.gif 我如何从dort_islem类中看到ilk_sayi? 问候….

DotNet.Highcharts:未按正确日期绘制成本

我正在创建一个使用两个表中的数据的DotNet.Highcharts图表:支出和收入。 我正在使用SQL语句为每个语句创建一个DataTable 。 第一个(用于Incomings)称为Dt包含IncCost和IncDate 。 名为Dt2的第二个(支出)包含ExpCost和ExpCost 。 我可以针对IncDate绘制针对IncDate和ExpCost 。 当我尝试连接IncDate和IncDate (最终)时出现问题,因为IncCost和ExpCost的成本是针对(最终)中日期的位置绘制的,而不是与其相关的实际日期。 以下是我用来创建每个DataTable的调用: SqlDataAdapter Adp = new SqlDataAdapter(“select CONVERT(DATETIME, IncDate, 103) AS IncDate, SUM(IncCost) AS IncCost from Incomings GROUP BY CONVERT(DATETIME, IncDate, 103) ORDER BY CONVERT(DATETIME, IncDate, 103)”, con); SqlDataAdapter Adp2 = new SqlDataAdapter(“select CONVERT(DATETIME, ExpDate, 103) AS ExpDate, SUM(ExpCost) AS ExpCost from Expenditures GROUP BY […]

动态(以编程方式)添加复选框和已检查的已更改事件

我以编程方式添加一些复选框和事件处理程序时遇到了一些问题。 复选框都显示正常,但点击时它们不会执行任何操作。 有谁知道我做错了什么? 我的代码: foreach (Statement i in theseStatements) { box = new CheckBox(); box.Text = i.StatementText; box.AutoPostBack = true; box.CheckedChanged += new EventHandler(this.CheckedChange); PlaceHolder.Controls.Add(box); } protected void CheckedChange(object sender, EventArgs e) { CheckBox x = (CheckBox)sender; Instructions.Text = “change”; WorkPlaceHazardsBox.Text += x.Text; }

在RDLC中动态生成列

我试图在ASP.NET中生成一个RDLC报告,其中我的数据集的列将是动态的,并且仅在运行时确定。 我有一个返回DataTable的函数,通过在RDLC报告向导中选择此函数, 我可以成功生成我的报告。 public DataTable GetTable() { // Here we create a DataTable with four columns. DataTable table = new DataTable(); table.Columns.Add(“Dosage”, typeof(int)); table.Columns.Add(“Drug”, typeof(string)); table.Columns.Add(“Patient”, typeof(string)); table.Columns.Add(“Date”, typeof(DateTime)); table.Columns.Add(“testColumn”, typeof(DateTime)); // Here we add five DataRows. table.Rows.Add(25, “Indocin”, “David”, DateTime.Now); table.Rows.Add(50, “Enebrel”, “Sam”, DateTime.Now); table.Rows.Add(10, “Hydralazine”, “Christoff”, DateTime.Now); table.Rows.Add(21, “Combivent”, “Janet”, DateTime.Now); table.Rows.Add(100, “Dilantin”, […]

如何将存储过程的多个结果存储到数据集中?

如何将StoredProcedure中的结果集合并到ASP.NET中的一个数据集中? 下面是我在asp.net中的代码 SqlDataAdapter adap = new System.Data.SqlClient.SqlDataAdapter(“sp_Home_MainBanner_TopStory”,con); adap.SelectCommand.CommandType = CommandType.StoredProcedure; adap.SelectCommand.Parameters.AddWithValue(“@rows”, 9); DataSet DS = new DataSet(); adap.Fill(DS, “Table1”); adap.Fill(DS, “Table2”); GridView1.DataSource = DS.Tables[“Table2”]; GridView1.DataBind(); 即使有两个适配器,我怎样才能将结果合并到一个数据集中?

文件上传读取到内存并用作文本文件 – 有更好的方法吗?

我有一个Intranet托管的Web应用程序,用户将上传一个包含5列空格分隔数据的文本文件。 我不想保存文件,所以我想在内存中使用它。 我在网上尝试了许多不同的例子,但都没有。 最后,一位同事告诉我如何做到这一点。 这是代码,我想知道是否有更好的方法来做到这一点。 最后,我想要的是一种将数据链接到gridview或转发器以便查看和以后存储到数据库(SQL Server)的方法。 上传文件asp标签ID是SurveyFileUpload SurveyDate是一个asp:输入字段 Int32 fileLen = SurveyFileUpload.PostedFile.ContentLength; // Create a byte array to hold the contents of the file. Byte[] buffer = new Byte[fileLen]; // Initialize the stream to read the uploaded file. Stream s = SurveyFileUpload.FileContent; // Read the file into the byte array. s.Read(buffer, 0, fileLen); // […]

在FormView中找不到控件?

我需要找到这个标签驻留在FormView控件中,我需要根据条件删除这个标签,但我无法使用FormView.FindControl方法找到它 here 我试过fvMediaIntro.FindControl()和fvMediaIntro.Row.FindControl() ,但都没有用。 有什么想法吗?