问题标签 [asp.net-2.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
3364 浏览

asp.net-2.0 - Roles.IsUserInRole 在以下简单场景中的行为是否符合预期?

在 .NET 2.0 的自定义角色提供程序(继承自 RoleProvider)中,IsUserInRole 方法已被硬编码为始终返回 true:

在配置为使用此角色提供程序的 ASP.NET 应用程序中,以下代码返回 true(如预期的那样):

但是,以下代码返回 false:

请注意, User.IsInRole("any rolename") 也返回 false。

  1. 这是预期的行为吗?
  2. 假设仅采用角色名称的重载仍会调用重写的 IsUserInRole 是否不正确?

更新:请注意,对于采用单个字符串的版本似乎没有可用的覆盖,这导致了我在 #2 中的假设。

0 投票
2 回答
2425 浏览

asp.net - 如何使用 ASP.net asp:RangeValidator 正确验证日期?

这是我的代码:

结果:

  • 01/01/2008 没有通过
  • 2008 年 2 月 2 日没有通过
  • 2000 年 11 月 11 日通行证
  • 2001 年 8 月 8 日通行证

我在这里想念什么?

0 投票
2 回答
149 浏览

configuration - 库中未附加 ASP.NET 配置

我正在开发一个包含两个项目的解决方案:一个 ASP.NET Web 应用程序和一个自定义 Web 控件库。自定义控件库用于 asp.net 应用程序。编译解决方案时,自定义web控件库的app.config文件没有和dll一起传到ASP.NET应用程序bin文件夹下?我怎样才能做到这一点?从该配置文件中读取的正确类是什么

0 投票
3 回答
2998 浏览

c# - 从asp.net代码中获取某个网站的源码

有什么方法可以从asp.net网站后面的代码中的一些c#代码中获取网站的来源(最好是字符串),比如说www.google.com?

编辑:当然我的意思是 html 代码 - 在每个浏览器中,您都可以使用上下文菜单中的“查看源代码”来查看它。

0 投票
3 回答
8425 浏览

asp.net - 捕获从 ASP.NET 生成的 HTML

如何最好地捕获由 aspx 页面呈现的 HTML(在我的实例中,用于日志记录)?

我不想使用 Response.Write 写回页面,因为它会打乱我的网站布局。

使用 Response.OutputStream 或 Response.Output 的流会导致 ArgumentException({System.ArgumentException: Stream was not readable.)

0 投票
1 回答
758 浏览

asp.net-2.0 - Data collection methods

I'm stumped again on how to proceed with a survey system I am working on. We have database data for matrix sytle questions (rows are various questions, columns are various answer types), where each cell needs to be able hold a different kind of control. We have a database framework for this. The problem comes with how to dynamcially render this onto the screen. We need to be able to control the placement of various answers. My initial thought was having to use a placeholder and write several LiteralControls into it to build the HTML for a table and control the spacing that way. Would it be possible to do this using a GridView instead? I am not sure which one would be the easier method. If there are other possiblities, I could really use the ideas. AJAX is not an option.

This is similar to a question I have previously asked, but this has more to do with the controls on the aspx page, rather than the bare logic behind it.

0 投票
5 回答
25775 浏览

.net - Asp.net 会话到期重定向到登录页面

会话到期时重定向到登录页面的最佳方法是什么。我正在使用

我可以在 web.config 文件中设置它吗?

0 投票
1 回答
507 浏览

c# - 在更新面板中找不到内容?

我有一个联系表格的表格,该表格包含另一个表格,无论是否需要扩展表格,该表格都被隐藏,因为该控件在多个页面上使用。所有这一切都很好,直到我在它周围放置了一个更新面板。我可以在后面的代码中看到控件并且页面构建成功,但是当我运行它时会抛出这个错误:

你调用的对象是空的。

我很确定我以前做过这种事情,但现在似乎不起作用。有没有其他人经历过这种情况?

0 投票
5 回答
6585 浏览

asp.net - 在asp.net页面和弹出页面之间发送数据?

asp.net 页面和弹出页面之间有哪些不同的通信方式?查询字符串等。哪个最安全?

0 投票
2 回答
2473 浏览

asp.net-2.0 - ASP.NET 2.0:为 ObjectDataSource 指定对象的实例

我正在使用 ObjectDataSource 将数据绑定到 GridView;它工作正常,只是它总是创建一个新对象用作数据源。我可以很好地完成所有设置,但我不能使用现有对象的实例来指定它的“数据源”。是否有可能做到这一点?如果是这样,怎么做?

如果不可能,为什么?

编辑:这是正在发生的事情的要点(对象类型已更改):在第一页上,您正在编辑狗的属性。其中一个属性是“有小狗”,如果它是真的,下一页你指定这些小狗的名字。就我而言,发生的事情是那些小狗没有与原来的狗联系在一起,而是与“新”狗联系在一起。(暗示我的问题是“母狗”是巧合。;-))