我FullCalendar
在我的asp.net mvc应用程序中使用.它不会加载事件.我通过ajax调用获取事件列表.以下是我的代码.有什么问题.
<div class="row">
<div class="col-lg-12">
<section class="panel">
<div class="panel-body">
<div id="calendar"></div>
</div>
</section>
</div>
</div>
<script type="text/javascript">
jQuery.extend({
getValues: function (url) {
var result = null;
$.ajax({
url: url,
type: 'get',
dataType: 'json',
async: false,
success: function (data) {
result = data;
},
error: function (err) {
alert(JSON.stringify(err));
}
});
return result;
}
});
var jsonEvents = $.getValues('@Url.Action("GetEvents", "Booking")');
alert(jsonEvents);
//var jsonEvents = [{ title: "Dhaval, (4,6), 6", start: "05/21/2016 1:05:00 PM" },
// { title: "Mohit, …
Run Code Online (Sandbox Code Playgroud) 我有一个MDIPrent表格,这是我的主要表格.现在我通过单击LogOut MenuStrip登出表单Main_Form.在我的代码中,我已经阻止了重复实例.但是我得到了这个错误.我用Google搜索了很多东西,尝试了很多东西,但错误并没有消失.下面是Program.cs文件的代码:
using System.Diagnostics;
static class Program
{
[STAThread]
static void Main()
{
LoggedInUser = string.Empty;
loginSuccess = false;
String thisprocessname = Process.GetCurrentProcess().ProcessName;
if (Process.GetProcesses().Count(p => p.ProcessName == thisprocessname) > 1)
return;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MyApplicationContext context = new MyApplicationContext();
Application.Run(context);
}
public class MyApplicationContext : ApplicationContext
{
private Login_Form lgFrm = new Login_Form();
public MyApplicationContext()
{
try
{
lgFrm.ShowDialog();
if (lgFrm.LogonSuccessful)
{
////lgFrm.Close();
lgFrm.Dispose();
FormCollection frm = Application.OpenForms;
try
{
foreach (Form fc in frm)
fc.Close();
}
catch (Exception ex){} …
Run Code Online (Sandbox Code Playgroud) 正如标题所说,我不知道我的代码有什么问题,但if (File.Exists)
即使文件存在,也会给出否定结果.
以下是我的代码
if (File.Exists(ZFileConfig.FileName.Replace(".xml", "_abc.xml")))
Run Code Online (Sandbox Code Playgroud)
在这里,ZFileConfig.FileName
是E:\\Application\\Application\\bin\\Debug\\resources\\FirstFile.xml
令人惊讶的是,这就是ZFileConfig.FileName.Replace(".xml", "_abc.xml")
我E:\\Application\\Application\\bin\\Debug\\resources\\FirstFile_abc.xml
所需要的.EVENTHOUGH IF
被罚下来返回TRUE.
几天前,我尝试通过右键单击照片来打印照片。出现一个对话框以选择打印机、纸张大小、质量等。我选择PaperSize = Legal
。打印机可以在 Legal 尺寸的纸张上打印(我使用的是 HP LaserJet 1020 plus 打印机)。
现在我试图从 C# 打印一些东西,设置 PaperSize,但打印机无法打印 Legal。下面是我的代码。代码有什么问题吗?
this.printDocument.PrinterSettings.PrinterName = this.printSetting.PrinterName;
PaperSize pkCustomSize1 = new PaperSize("8.5x13", 1300, 850);
this.printDocument.DefaultPageSettings.PaperSize = pkCustomSize1;
this.printDocument.DefaultPageSettings.PaperSize.RawKind = 119;
printPreviewDialog.Document = printDocument;
printDocument.Print();
private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Graphics g = e.Graphics;
Bitmap bm = new Bitmap(300, 3000);
// Code for bm.
g.DrawImage(bm, 0, 0);
}
Run Code Online (Sandbox Code Playgroud)
所以问题是,设置 PaperSize(和 PrinterSetting)的正确方法是什么?还有一件事,我搜索了MaximumPrintableArea
一台打印机。我的打印机有最大 A4 尺寸,为什么它可以打印Legal
?
我在报告中为日期范围添加了两个文本框.要填充文本框中的值,我将参数设置为文本框.
现在,日期范围来自名为DateRange的表单,该表单具有两个DateTimePickers.
如何设置rdlc中的文本框的值等于这些DataTimePickers?
我Attribute Routing
在MVC4
申请中使用.我已设定路线[Route("test-{testParam1}-{testParam2}")]
.这里`{testParam2}'可能包含'test'这个词.例如,如果我输入如下的网址,
localhost:33333/test-temp-test-tempparam2
Run Code Online (Sandbox Code Playgroud)
这给了我404错误.在url中,这里{testParam2}
有两个单词test tempparam2
格式化为test-tempparam2
.当test
单词位于最后位置时{testParam2}
,它运行良好.这意味着如果网址像.../test-temp-tempParam2-test
运行良好.但是下面给出错误..../test-temp-test-tempParam2
.
以下是可能有帮助的代码......
[Route ("test-{testParam1}-{testParam2}")]
public ActionResult Foo (int testParam2) {...}
Run Code Online (Sandbox Code Playgroud)
现在尝试关注两个网址.
localhost:(port)/test-temp-1
localhost:(port)/test-test-temp-1
在我的情况下,第二个错误.在这种情况下第一参数被格式化为test-temp
从test temp
.首先运行良好.
如何解决这个问题呢?
我有两台笔记本电脑.
1)BuildLaptop->我编写应用程序的笔记本电脑.Windows 7旗舰版32位,适用于数据库的Office 2007
2)TestLaptop->测试应用程序.Windows 7旗舰版64位,Office 2007.
我的应用程序包含几个构建为AnyCPU的dll文件,该应用程序也构建为AnyCPU.
当我尝试在TestLaptop上测试我的应用程序时,它给了我一个错误:
Microsoft.ACE.OleDb.12.0提供程序未在您的计算机上注册.
所以我从TestLapTop卸载了Office并在BuildLapTop上安装了Office.
同样的错误.然后我尝试编译所有的dll以及我的应用程序到x64.该应用程序无法启动.然后我尝试只将应用程序编译为x64并将dll编译为anyCPU.错误再次发生.
那么帮助我如何让我的应用程序在TestLapTop上运行?
我正在尝试打印一些string
s Graphicss.DrawString()
.我已设置边距printdocument
但不是从页面的原点开始.我已margins
到(0,0,0,0)
,但不知它打印页面的顶部边缘低于一半厘米.另一件事是它可以从左边缘打印.
以下是我的代码.
private void button1_Click(object sender, EventArgs e)
{
////PaperSize pkCustomSize1 = new PaperSize("First custom size", 1020, 3517);
////printDocument1.DefaultPageSettings.PaperSize = pkCustomSize1;
printPreviewDialog1.Document = printDocument1;
printDocument1.PrinterSettings.PrinterName = this.comboBox1.Text;
Margins margins = new Margins(0, 0, 0, 0);
printDocument1.PrinterSettings.DefaultPageSettings.Margins = margins;
printPreviewDialog1.Show();
printDocument1.Print();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int resX = GetPrinterResolutionX(comboBox1);
int resY = PrnOpra.GetPrinterResolutionY(comboBox1);
Graphics g = e.Graphics;
float scale = resX / ScrnRes;
Bitmap bm = new …
Run Code Online (Sandbox Code Playgroud) 正如问题所述,我想在 RDLC 报告中添加多个表格。我在几份报告中添加了一张表格。但是不知道如何在一个报表中添加多个表。我正在使用objects
as添加表格DataSource
。我的数据库是SQLite
.
我发现了一个教程,使rdlc
使用object
作为datasource
在这里。但这并不能说明多个表。怎么做?
我正在使用STUFF
功能。我有一些条目具有&但显示& ; 反而。我在某处读到 & 保留在 XML 中。如何解决这个问题。
...STUFF((SELECT (', ' + CategoryName) FROM CategoryTable WHERE CategoryId IS NOT NULL AND CategoryId IN (1,2,3) FOR XML PATH('')), 1, 1, '') as CategoryName,...
Run Code Online (Sandbox Code Playgroud)
以上是我的查询(好吧,我刚刚添加了完整查询的一部分。)。怎么解决。谢谢。
在我的应用程序中,我添加了一个Properties.cs文件,其中包含我将在整个应用程序中使用的属性.我得到NullReferenceException =>Object reference not set to an instance of an object.
这是Properties.cs的代码
public class Properties
{
private static string type1;
public static string Type1
{
get
{
return type1;
}
set
{
type1= value;
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我以我的一个表单访问此属性时,我收到错误.例如
if (Properties.Type1.Equals(string.Empty) || Properties.Type1.Equals(null))
{
// Do something
}
Run Code Online (Sandbox Code Playgroud) 我正在计算我的字符串中有多少*符号.但我得到一个错误.
System.dll中出现未处理的"System.ArgumentException"类型异常
我只是使用正则表达式匹配来检查它.当我用任何其他字符串进行测试时,它工作得很好,但是当我搜索"*"时,它是一个例外.
这是给出表达式的代码
string abc = "i am just trying *** for a sample code";
var count = Regex.Matches(abc, "*").Count;
Console.Out.WriteLine(count);
Run Code Online (Sandbox Code Playgroud)
这一个很完美
string abc = "i am just trying for a sample code";
var count = Regex.Matches(abc, "a").Count;
Console.Out.WriteLine(count);
Run Code Online (Sandbox Code Playgroud)
任何想法为什么?
c# ×10
winforms ×7
.net ×6
printing ×2
rdlc ×2
asp.net-mvc ×1
fullcalendar ×1
jquery ×1
sql ×1
sql-server ×1
sqlite ×1