有没有办法用CSS根据类型定位所有输入?我有一个禁用的类我在各种禁用的表单元素上使用,我正在设置文本框的背景颜色,但我不希望我的复选框获得该颜色.
我知道我可以用单独的类来完成这个,但是如果可能的话我宁愿使用CSS.我敢肯定,我可以在javascript中设置它,但再次寻找CSS.
我的目标是IE7 +.所以我认为我不能使用CSS3.
编辑
使用CSS3,我可以做类似的事情吗?
INPUT[type='text']:disabled
那会更好地完全摆脱我的班级......
编辑
好的,谢谢你的帮助!所以这里是一个选择器,修改所有已禁用的文本框和区域,而不需要设置任何类,当我开始这个问题时,我从未想过这是可能的......
INPUT[disabled][type='text'], TEXTAREA[disabled]
{
background-color: Silver;
}
Run Code Online (Sandbox Code Playgroud)
这适用于IE7
我需要将IE和FF浏览器与其他浏览器分开
这是一个伪代码:
If (CurrentBrowser == IE(6+) or FF(2+) )
{
...
}
else
{
...
}
Run Code Online (Sandbox Code Playgroud)
在protected void Page_Load()
事件中(这样认为)
if ((Request.Browser.Type == "IE") || (Request.Browser.Type == "FF"))
{
WebMsgBox.Show("1111");
}
Run Code Online (Sandbox Code Playgroud)
没有效果: - /什么是IE和FF类型?
我一直试图让.NET 4.5(System.IO.Compression.ZipArchive
)中包含的"新"ZipArchive 在ASP.NET站点中工作.但似乎它不喜欢写入流HttpContext.Response.OutputStream
.
我的下面的代码示例将抛出
System.NotSupportedException:不支持指定的方法
只要在流上尝试写入.
该CanWrite
流上的属性返回true.
如果我将OutputStream与文件流交换,指向本地目录,它就可以工作.是什么赋予了?
ZipArchive archive = new ZipArchive(HttpContext.Response.OutputStream, ZipArchiveMode.Create, false);
ZipArchiveEntry entry = archive.CreateEntry("filename");
using (StreamWriter writer = new StreamWriter(entry.Open()))
{
writer.WriteLine("Information about this package.");
writer.WriteLine("========================");
}
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
[NotSupportedException: Specified method is not supported.]
System.Web.HttpResponseStream.get_Position() +29
System.IO.Compression.ZipArchiveEntry.WriteLocalFileHeader(Boolean isEmptyFile) +389
System.IO.Compression.DirectToArchiveWriterStream.Write(Byte[] buffer, Int32 offset, Int32 count) +94
System.IO.Compression.WrappedStream.Write(Byte[] buffer, Int32 offset, Int32 count) +41
Run Code Online (Sandbox Code Playgroud) 如何在html/css/javascript中创建进度条.我真的不想使用Flash.可以在这里找到的东西:http://dustincurtis.com/about.html
我真正想要的只是一个'进度条',它改变了我在PHP中给出的值.你的过程会是什么?这有什么好的教程吗?
我有以下错误消息:
无法打开登录请求的数据库"SmallBakery".登录失败.用户'IIS APPPOOL\MyAppPool'登录失败
怎么能纠正这个?我正在使用Windows 7企业版和Sql server 2012.
我仍然有启动画面的问题.我不想使用该属性SC.TopMost=true
.
现在我的应用场景如下:
在progeram.cs中:
[STAThread]
static void Main()
{
new SplashScreen(_tempAL);// where _tempAL is an arrayList
Application.Run(new Form1(_tempAL));
}
Run Code Online (Sandbox Code Playgroud)
在SplashScreen类中:
public SplashScreen(ArrayList _Data)
{
DisplaySplash()
}
private void DisplaySplash()
{
this.Show();
this.TopMost = true;
this.CenterToScreen();
this.SetTopLevel(true);
_allServerNarrators = new string[10];
for (int i = 0; i < _allServerNarrators.Length; i++)
_allServerNarrators[i] = null;
GetFromServer();
this.Hide();
_serverData = new ArrayList();
_thisData.Add(_allServerNarrators);
_thisData.Add(_serverNarrators);
}
private void GetFromServer()
{
_serverNarrators = new ArrayList();
string _file = "Suras.serverNar";
if (!Directory.Exists("c:\\ASGAQuraan"))
Directory.CreateDirectory("c:\\ASGAQuraan");
while (counter < …
Run Code Online (Sandbox Code Playgroud) 是否可以更改<select/>
HTML表单中元素的边框颜色?
该border-color
样式适用于Firefox,但不适用于IE.
我在谷歌上找不到真正的答案.
考虑代码片段.
IList<String> obj=new List<string>();
IEnumerable<Object> obj1 = obj;
Run Code Online (Sandbox Code Playgroud)
但如果我写ICollection<Object> obj2 = obj;
它会抛出编译时错误.
无法隐式将类型'
System.Collections.Generic.IList<string>
' 转换为'System.Collections.Generic.ICollection<object>
'.
为什么,因为这种行为List<T>
同时实现了IEnumerable<T>
和ICollection<T>
,也IList<T>
被定义为
public interface IList<T> : ICollection<T>, IEnumerable<T>, IEnumerable
{
T this[int index] { get; set; }
int IndexOf(T item);
void Insert(int index, T item);
void RemoveAt(int index);
}
Run Code Online (Sandbox Code Playgroud) 我知道这对于位置很容易:固定,但不幸的是我坚持支持IE 6.我怎么能这样做?我宁愿使用CSS来干净,但如果我必须使用Javascript,那不是世界末日.在我目前的实现中,我有一个"浮动页脚"浮动在主要内容区域上方,并使用Javascript定位.我现在的实现即使使用Javascript也不是特别优雅,所以我的问题是:
new FloatingFooter("floatingDiv")
).我猜想没有超级简单的解决方案可以满足上述所有要求,但我可以构建的东西会很棒.
最后,只是一个更普遍的问题.我知道这个问题很难解决,那么其他UI替代方案是什么,而不是在每个页面的底部都有页脚内容?在我的特定网站上,我用它来显示步骤之间的转换.还有其他方法吗?
这是可能做到这一点:
public static void SomeMethod<TFunc>(Expression<TFunc> expr)
{
//LambdaExpression happily excepts any Expession<TFunc>
LambdaExpression lamb = expr;
}
Run Code Online (Sandbox Code Playgroud)
并在其他地方调用它传递参数的lambda:
SomeMethod<Func<IQueryable<Person>,Person>>( p=>p.FirstOrDefault());
Run Code Online (Sandbox Code Playgroud)
我想改为将表达式作为参数传递给属性构造函数. 可以这样做吗?
class ExpandableQueryAttribute: Attribute {
private LambdaExpression someLambda;
//ctor
public ExpandableQueryMethodAttribute(LambdaExpression expression)
{
someLambda = expression
}
}
//usage:
static LambdaExpression exp =
(Expression<Func<IQueryable<Person>, Person>>)
(p => p.FirstOrDefault());
[ExpandableQueryAttribute(exp)] //error here
// "An attribute argument must be a constant expression, typeof expression
// or array creation expression of an attribute parameter type"
Run Code Online (Sandbox Code Playgroud)
我的目标是在属性的构造函数中指定方法或lambda(即使我必须声明一个完整的命名方法并以某种方式传递方法的名称,这样就可以了).
参数类型可以更改,但重要的是属性构造函数可以获取该参数,并以某种方式将其分配给LambdaExpression类型的字段
我希望lambda …
c# ×5
css ×4
asp.net ×2
html ×2
javascript ×2
.net-4.5 ×1
asp.net-4.5 ×1
covariance ×1
generics ×1
html-select ×1
httpcontext ×1
iis-7 ×1
lambda ×1
outputstream ×1
progress-bar ×1
sql-server ×1
winforms ×1