小编Ovi*_*Ovi的帖子

将不透明度添加到css类

有没有办法在css类中设置不透明度,在jquery中你可以这样做:

$(result).parent().css({ 'background-color': '#eeeeee', 'opacity': '0.7' })
Run Code Online (Sandbox Code Playgroud)

无论如何?
我需要将它们放在css类中的属性中.

css jquery opacity background-color

2
推荐指数
1
解决办法
4873
查看次数

字符串未被识别为有效的DateTime,asp.net

,嗨,

我有一个asp.net和c#网站.

在我使用的asp代码中

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>
Run Code Online (Sandbox Code Playgroud)

当我运行我的项目时,我收到此错误:

字符串未被识别为有效的DateTime.

我在我的网站上没有使用任何dataTime的东西.

然后,当我刷新页面时,错误消失.

堆栈跟踪:

 [FormatException: String was not recognized as a valid DateTime.]
   System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +3610514
   System.Windows.Forms.TypeLibraryTimeStampAttribute..ctor(String timestamp) +49
   System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) +0
   System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) +46
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +529
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103
   System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +33
   System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +76
   System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() …

c# asp.net datetime scriptmanager

1
推荐指数
1
解决办法
2811
查看次数

Server.MapPath()没有获得所需的路径

我有一个asp.net网站,其中包含以下目录:

C:\用户\桌面\测试的\ src \网站

我有另一个名为"files"的文件夹,它位于:

C:\Users\Desktop\Testing\src\files
Run Code Online (Sandbox Code Playgroud)

从我的项目内部我试图从"文件"文件夹中读取文件,我这样做:

var path = HttpContext.Current.Server.MapPath("/files"); 
Run Code Online (Sandbox Code Playgroud)

我也尝试过:

var path = HttpContext.Current.Server.MapPath(".."); 
Run Code Online (Sandbox Code Playgroud)

但它说 Failed to map the path '/files'.

这可能是什么原因?它可以用我的IIS做点什么吗?我怎么能让这个工作?

谢谢!

asp.net iis directory server.mappath

1
推荐指数
1
解决办法
5684
查看次数

带有c#条件的foreach循环

我在c#中有这个foreach循环,因为我是c#的新手,我想知道这是否可以写得更短(条件是循环的一部分)

foreach (PagerPageFilterInformation filter in PageFilterInformation)
{
    if (filter.Ancestor == myParent)
    {
        DoSomething()...//Using filter
        break;
    }
}
Run Code Online (Sandbox Code Playgroud)

我试过做:

PagerPageFilterInformation filter = PageFilterInformation.FirstOrDefault(filter => filter.Ancestor == myParent);
if(filter != null)
{
DoSomething()...}
Run Code Online (Sandbox Code Playgroud)

但它没有用.可能是因为班级:

PagerPageFilterInformation
Run Code Online (Sandbox Code Playgroud)

继承自类:

PageFilterInformation
Run Code Online (Sandbox Code Playgroud)

c# foreach conditional-statements

1
推荐指数
1
解决办法
4588
查看次数

在 C# 中使用 \r\n 打印字符串以开始新行

我有一个 asp.net 和 c# 项目。

我需要打印这个字符串,我从服务器得到它是这样的:

Working...: 0/0\r\nNavigating: 0/0
Run Code Online (Sandbox Code Playgroud)

它应该以 2 个单独的行打印出来(使用 \r\n),它不应该自动执行吗?

难道我做错了什么?

我无法更改字符串,但我使用它的方式是:我有一个 EO 进度条,我发送如下消息:

_progressBar.UpdateProgress(_count, progress.Message);
Run Code Online (Sandbox Code Playgroud)

它会在进度条下显示消息。该消息是我发布在顶部的字符串。

谢谢

c# asp.net string newline

0
推荐指数
1
解决办法
8357
查看次数