我正在使用print css来隐藏某些元素,并在我不需要它时停止分页符.用户可以选择在打印之前隐藏部分.
我的问题是,当我打印预览时,总会有一个额外的空白页面(最后在Chrome和Firefox中,在Opera的开头),我无法弄清楚原因.IE没有问题,没有额外的页面(这是令人震惊的......)
我非常感谢一些意见.我尝试过制作容器div page-break-after:avoid; 和分页后:自动; 但都没有奏效.同时取出table.plain {page-break-inside:avoid; 没有什么区别.
当用户单击隐藏图标时,exclude类将添加到表中.这有效,并且带有排除类的任何内容都不会显示在打印中.用户想要打印的最后一页可能适合一页或不适合.
这是我的HTML:
<body>
<div id="main">
<div id="content">
<div id="side" class="exclude">
...logo, etc, shown at side on screen...
</div>
<div id="data">
<table class="printOnly plain printHeader">
...logo, etc, to print at top...
</table>
<div>
<table class="detail plain">
<tbody>
<tr>
<td class="rel">
<div class="abs exclude visibility">
<a href="#" class="show ico-show ico hid">Show</a>
<a href="#" class="hide ico-hide ico">Hide</a>
</div>
<h3>Contact</h3>
</td>
</tr>
...more tr with contact details...
</tbody>
</table>
...more tables with other details...
</div> …Run Code Online (Sandbox Code Playgroud) 我看过这个问题,但是因为它使用了NLog.config文件,所以我无法将答案转化为我需要的内容.NLog - 将NULL写入可选数据库列
我刚刚开始使用NLog,因为它被建议作为我问的另一个问题的答案.由于我在类库中使用它,并且我不想在每个使用该库的应用程序中放置NLog.config文件,因此我使用的是配置API.
我想要做的是在我的日志表中将一些列设置为NULL,当它们不是必需/指定时.我可以让NLog写一个空字符串,但不是NULL.
我试图配置NLog来执行存储过程,但它似乎不起作用.
目前我正在设置一个包含用户名,密码等的数据库目标,以及以下命令文本:
target.CommandText = "insert into Log(time_stamp,log_level,logger,message,exception_type,target_site,stack_trace,data,inner_exception) values(@time_stamp, @level, @logger, @message, @type, @target, @trace, @data, @inner);";
Run Code Online (Sandbox Code Playgroud)
然后向目标添加参数,例如
var param = new DatabaseParameterInfo();
param.Name = "@time_stamp";
param.Layout = "${date}";
target.Parameters.Add(param);
Run Code Online (Sandbox Code Playgroud)
所以这只会添加一个空字符串:
var param = new DatabaseParameterInfo();
param.Name = "@type";
param.Layout = "";
target.Parameters.Add(param);
Run Code Online (Sandbox Code Playgroud)
但这不起作用,因为需要布局:
var param = new DatabaseParameterInfo();
param.Name = "@time_stamp";
param.Layout = null;
target.Parameters.Add(param);
Run Code Online (Sandbox Code Playgroud)
我已经尝试执行存储过程,更改命令文本如下(并在之后添加上面的参数,包括空字符串而不是空值):
target.CommandText = "exec usp_InsertLog @time_stamp, @level, @logger, @message, @type, @target, @trace, @data, @inner";
Run Code Online (Sandbox Code Playgroud)
根据SQL Server Profiler(为清晰起见,换行符)生成此内容:
exec sp_executesql …Run Code Online (Sandbox Code Playgroud) 问题:当我尝试将更改推送到存储库时,出现身份验证错误。
GitHub Desktop 中的错误:
命令行错误:
sslverify 打开时:
致命:无法访问'https://github.com/jacquibo/neo4jDataSets.git/':SSL证书问题:无法获取本地颁发者证书
sslverify 关闭时:
信息:请在浏览器中完成身份验证...
致命:不正确的客户端凭据:传递的 client_id 和/或 client_secret 不正确。[https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#in Correct-client-credentials]
“https://github.com”的用户名':my@githubemail.co.uk
'https://my@githubemail.co.uk@github.com'的密码:
远程:无匿名写入权限。
致命:“https://github.com/myusername/myrepo.git/”身份验证失败
我努力了:
ssh -i mycertname -vT git@github.com我收到一条权限被拒绝的消息,请参见下文)使用命令行测试 SSL 证书时出错:
OpenSSH_8.4p1、OpenSSL 1.1.1h 2020 年 9 月 22 日
debug1:读取配置数据 /etc/ssh/ssh_config
debug1:连接到 github.com …
我是EF Code First的新手,我正在尝试使用代码优先迁移为我的数据库添加一些数据.到目前为止,我已设法解决了几个错误,但现在我陷入困境,无法找到答案.从我的代码更新数据库时,我有两个问题.
我有几个具有各种多对多和一对一关系的对象,有些最终会创建一个圆圈.当我尝试为数据库播种时,我不确定这是否是第二个问题的原因.
A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'LicenseId'.有没有办法可以使用db生成的id作为外键?这只是我创建/插入对象的顺序吗?(见下面的播种代码)
如果我不在[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]许可证中使用,我会收到一条错误,指出无法隐式插入数据库未生成的ID.
public class License : Entity
{
[Key, ForeignKey("Customer")]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int LicenseId { get; set; }
[Required(ErrorMessage = "Date Created name is required")]
public DateTime DateCreated { get; set; }
public virtual ICollection<ProductLicense> ProductLicenses { get; set; } // one License has many ProductLicenses
public virtual Customer Customer { get; set; } // one Customer has one …Run Code Online (Sandbox Code Playgroud) c# ef-code-first asp.net-mvc-4 ef-migrations entity-framework-6
我没有在互联网上的任何地方找到这些信息所以我想在这里发布,因为我自己找到了答案.
我想在电子表格中使用NPOI创建具有边框的单元格,并且如何做到这一点并不明显.
在遵循为DotNetNuke模块设置开发环境的教程时,从项目模板创建新项目会导致以下错误:
The Web Application Project xxx is configured to use IIS.
The Web server "http://dnndev/desktopmodules/xxx/' could not be found."
Run Code Online (Sandbox Code Playgroud)
如何修复这个问题,因为教程完全遵循了?
c# ×2
.net ×1
asp.net-mvc ×1
border ×1
css ×1
dotnetnuke ×1
dotnetnuke-7 ×1
git ×1
github ×1
iis ×1
iis-6 ×1
nlog ×1
npoi ×1
printing ×1
spreadsheet ×1
sql-server ×1
ssh-keys ×1
xls ×1