我有一个WPF应用程序,我必须在其中进行多次更新.
其中一个更新是我正在从Label更改为TextBox
我在许多示例中看到了从XAML设置的文本框边框颜色,这对我不起作用,因为有业务规则条件有红色或黑色
我试过了:
lblValidMsg.BorderBrush = Brushes.Red;
lblValidMsg.BorderBrush = System.Drawing.Color.Red; // converter.ConvertFromString("#FF0000"); //borderColor;
lblValidMsg.BorderBrush = SystemColors.Control;
private Color borderColor = Color.Gray;
Run Code Online (Sandbox Code Playgroud)
我确信它是"简单的",但不断的不同错误就像
Cannot implicitly convert type 'System.Drawing.Color' to 'System.Windows.Media.Brush'
Run Code Online (Sandbox Code Playgroud)
是的我知道我将文本框名称作为标签名称,因此以"lbl"开头
更新:
我看到人们设置背景和前景,但这不是我需要做的
textBox1.Background = Brushes.Blue;
textBox1.Foreground = Brushes.Yellow;
Run Code Online (Sandbox Code Playgroud)
我确实试过了
lblValidMsg.BorderBrush = Brushes.Red;
Run Code Online (Sandbox Code Playgroud)
这样就不能隐式地将类型'System.Drawing.Color'转换为'System.Windows.Media.Brush'
我已经查看了各种stackoverflow的答案,但我没有看到修复我与linq的连接的方法.
2桌
var query = from tips in TblTips
where tips.Id == 30
join files in TblFiles on tips.Id equals files.Group
select new { tips, files };
Run Code Online (Sandbox Code Playgroud)
错误:
Type inference failed in the call to Join
Run Code Online (Sandbox Code Playgroud)
现在tips.Id是一个int而files.Group是一个varchar
我试过做.Value
tips.id.Value --> the word Value not working (most recent linqpad)
(int)files.Group --> it doesn't like that ...
Run Code Online (Sandbox Code Playgroud) 我有一个在localhost上运行的asp.net Web表单应用程序:6414 然后jquery ajax在localhost上调用Web Api服务:11974
我收到错误
The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'http://localhost:6414' is therefore not allowed access.
Run Code Online (Sandbox Code Playgroud)
所以我梳理了谷歌和stackoverflow,发现了大量相互矛盾的 信息.
1. Fix with web.config
2. Fix with jquery ajax call
3. Fix with CORS in web.api
Run Code Online (Sandbox Code Playgroud)
我尝试过启用Cors和web.config以及各种技术.
目前我想知道问题实际上是Web表单jquery代码作为发送者,但实际上响应头部意味着它来自web api服务...
我看看我的响应标题,我看到其中的两个
Access-Control-Allow-Origin:* ( repeated TWICE)
Run Code Online (Sandbox Code Playgroud)
我尝试在Web Api Project中的web.config中注释掉这一行
<add name="Access-Control-Allow-Origin" …
Run Code Online (Sandbox Code Playgroud) 可悲的是,我需要在nonasp.net网站上使用IFrame.服务器将托管两个应用程序.
Iframe加载内容,但当我点击此按钮链接时,它会给出错误:
in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Run Code Online (Sandbox Code Playgroud)
在剃刀中我使用的是Url.Action,我读到了关于使用的内容
&output=embed
Run Code Online (Sandbox Code Playgroud)
所以我试图这样做:
<button class="btn btn-success" onclick="location.href='@Url.Action("AddComment", "Home", new { id = item.id })&output=embed';return false;">Add Comment</button>
Run Code Online (Sandbox Code Playgroud)
然后我得到了错误
A potentially dangerous Request.Path value was detected from the client (&).
Run Code Online (Sandbox Code Playgroud)
然后我尝试将其添加到web.config
<system.web>
<httpRuntime requestPathInvalidCharacters="" requestValidationMode="2.0" />
<pages validateRequest="false" />
</system.web>
Run Code Online (Sandbox Code Playgroud)
然后我收到了这个错误......
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Run Code Online (Sandbox Code Playgroud)
更新:
我发现即使没有Iframe,网址最终会是:
http://localhost:17308/Home/AddComment/4&output=embed
1. would that URL …
Run Code Online (Sandbox Code Playgroud) 我有一个SQL语句,我需要转换为Linq-to-SQL.
有效的SQL语句是
Select
Comment, count(*) as counted
from
[ESO].[ESO].[DOCCCOIssues]
group by
comment
Run Code Online (Sandbox Code Playgroud)
Linq我有一个问题
var issueModel = new IssuesModel();
var query = (from c in DOCCCOIssues//.IssuesModels
//group c by c.Comment into g
select new
{
c.Comment,
//Count = g.Count()
});
Run Code Online (Sandbox Code Playgroud)
select c).Count()
,这不是我想要的我已经看过MANY谷歌和计算器的例子
我确实创造了一个小提琴来展示我的问题.
问题陈述."点击他们的名字后,我想在第一栏中找到该人的姓名." 我已经将它翻转为每一行的高亮显示为黄色,我可以让Jquery做一个点击事件,这样就行了,但是当我执行这个代码时,它会为该列中的每一行吐出所有文本值
$(document).on('click', '.nameField', function () {
//console.log('t');
var x = $(".nameField").text();
//var x = $(this).parent(".nameField").text();
console.log(x);
});
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/bthorn/7ck1m7q1/2/
更多信息.
单击"使用动态表填充DIV"按钮
同样在顶部,注意一个STATIC,在那里顶部的工作,以获得名称没有问题,好吧,只有一行虽然
更新我在那行上需要ALIAS我在别名列中的td上创建了一个新类,我怎么能得到它?
我的日期看起来像这样
2015-10-14T17:54:19.033
Run Code Online (Sandbox Code Playgroud)
业务分析师似乎希望它看起来像这样:
mm/dd/yy
e.g.
10/14/2015
Run Code Online (Sandbox Code Playgroud)为什么会有"T"?还有额外的时间吗?
c# ×4
jquery ×3
javascript ×2
linq ×2
sql-server ×2
ajax ×1
asp.net ×1
asp.net-mvc ×1
css ×1
html ×1
iframe ×1
linq-to-sql ×1
linqpad ×1
wpf ×1
xaml ×1