问题标签 [asp.net-dynamic-data]

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 投票
1 回答
324 浏览

asp.net - 如何根据动态数据网站同一张表中另一个字段的数据验证一个字段?

我的动态数据网站中有一个表格,其中包含一个主要电话号码字段和一个国家/地区字段。我有验证美国国内电话号码和国际电话号码的电话字段的正则表达式。我将如何在我的动态数据应用程序中编写如果在 Country 字段中选择了美国以外的国家,那么应该使用国际电话正则表达式?

0 投票
1 回答
1889 浏览

asp.net - 在常规 asp.net 页面上的 Gridview 列中使用 DynamicDataManager 控件加载外键值

我正在开发一个可以对数据库中的主表执行添加、编辑和删除操作的 gridview。在编辑操作中,它应该填充下拉控件中的所有外键值((如果有)。

我遇到了用于此场景的 dynamicdataManager 控件,发现它可以在 Asp.net Web 表单中轻松使用,然后无需创建专用的动态数据网站。

我能够将数据与 LinqDataSource 绑定,但我无法在其中一列中加载外键值。我在数据库中设置了两个表来创建示例。

表的结构是:

父表

我为这两个表创建了一个 LINQDataSource,类关系如下图所示:

在此处输入图像描述

现在,我的 gridview 中有动态字段来显示 LK_CardTypes 列表,其中一个是引用类“RefTest”的名称。当我运行我的页面时,我会看到类名而不是引用表“RefTest”中的值。

我知道我遗漏了一些东西,因为我没有在代码中提到 Ref_Name 映射到 Ref_Id 的任何地方。

我的 gridview 的 Html 标记是:

在 Page_Init 事件中,我在 gridview 上启用了动态数据,并已将控件注册到 DynamicDataManager 控件

我需要在 Gridview 控件的字段级别进行一些设置还是需要在 LinqDataSource 中进行一些设置?

0 投票
1 回答
530 浏览

c# - ASP.Net Dynamic Data Linq to Sql Web App 中没有插入、删除、详细信息链接

我创建了 ASP.Net Dynamic Data Linq to Sql Web Application。我将Linq to Sql项添加到项目中并成功配置了数据库表和项目之间的连接。我运行Default.aspx,我看到表名。点击它时,我只能看到数据库表中的项目,没有' t 任何删除、插入、详细信息链接。它的样子是:

http://www.deryanurulus.com/Untitled.png

我更正了 Global.asax.cs 文件中的行,例如:

我的项目中缺少什么,为什么我看不到更新链接(删除、插入)?谢谢..

0 投票
2 回答
1495 浏览

c# - 动态数据:如何动态启用-禁用行编辑?

我有使用动态数据技术实现的 Asp.net 应用程序。我数据库中的所有数据都显示在 DetailsView(动态数据的标准)中。DetailsView 中的每一行都包含带有编辑和删除按钮的图标。在某些情况下,我应该禁用行编辑并在某些行中隐藏编辑删除按钮。在动力学上是否可能。

PS我找到了DetailsView.AutoGenerateEditButton属性,但它不适用于我:该属性只是隐藏所有网格的编辑删除按钮,而不是某些行。

0 投票
2 回答
118 浏览

asp.net - DynamicData - 动态 Linq 类

任何人都知道是否有可能;

  1. 为定期更改的表/列动态创建 LINQ 类?
  2. 如果该创建可以在 DynamicData 中使用。

我们正在开发的 Web 应用程序在 SQL 中创建表和列。我们想在 DynamicData 中编辑这些表。

想法?

0 投票
0 回答
554 浏览

asp.net - ASP.NET DynamicData 验证自定义图像字段模板

我创建了一个可以正常工作的自定义图像字段模板。我决定为图像大小创建某种验证,所以我创建了一个自定义验证属性。这是代码:

这是我的 FieldTemplate Image_Edit.ascx:

这是 Image_Edit.ascx.cs:

最后是我的实体元数据类:

有两个问题:

1- 当 IsValid(object value) 调用的值始终为空!

2-尝试上传新图像时,我总是在验证的客户端收到“值无效”错误。

0 投票
4 回答
1031 浏览

c# - DynamicData - 如何在 Children.ascx.cs FieldTemplate 中显示子数?

MS DynamicData 的 Children.ascx.cs 文件有一个Page_Load方法可以返回一个超链接,上面写着“查看孩子”。我想将孩子的数量附加到超链接文本的末尾。下面是我的尝试。如何让超链接显示“查看儿童 - # 条目”?

0 投票
3 回答
600 浏览

asp.net - 防止空字符串在 asp.net 动态数据中变为 NULL

我有一个标准的 ASP.NET 4 动态数据站点(使用 Linq to SQL)。

在我的 SQL-Server 数据库中,我有数百个设置为 NOT NULL 的 varchar 字段,但默认值为空字符串。它们永远不应该为 NULL,但它们可能有一个空字符串作为内容。

在动态数据站点上编辑这些字段时,内部逻辑将字段视为 NOT NULL 并且介于 TextBox1.Text (这是一个空字符串)之间并调用 UPDATE sql 它将值设置为 NULL 并且它们更新失败。

我可以看到 System.Web.DynamicData.MetaColumn 有一个属性“ConvertEmptyStringToNull”,但它是只读的。

我可以做些什么来防止空字符串变为 NULL 而不必更改所有数百个字段的属性?

0 投票
0 回答
206 浏览

asp.net - spring.net 动态数据项目中的依赖注入

我正在尝试在 asp.net 动态数据项目中使用 spring.net 进行依赖注入。Spring 配置正确,因为服务定位器模式有效。

我将 spring 配置为 web.forms 项目,但依赖注入不适用于动态页面。

有谁知道如何对动态页面进行注入?

编辑: 在 asp.net 路由中看起来有这个问题。动态数据框架使用路由处理动态页面。根据下一个链接 spring.net 还不能使用路由。

http://forum.springframework.net/showthread.php?7306-Asp.Net-Routing-in-web-form-and-missing-injection

0 投票
2 回答
1570 浏览

asp.net - ASP.NET Dynamic Data: Display a dynamic list of filter criteria in a side bar

I have a set of categories that a user can choose from. Each category has a different set of properties that a user may want to filter on.

The items in each category are displayed in a grid view. Each category has its own web page for the grid view.

When the grid view is displayed I would like a side bar to display properties that pertain to the category. The user should be able to select a property to filter. And filter by min/max values on the property.

I'm trying to determine what controls should go in the sidebar and also how to dynamically populate the set of controls (assuming each one is a distinct property filter).

For example looking at Amazon books the sidebar has a dynamically generated list of filters that pertains to the category of books.

Other nice features would be:

  • Change the list of properties so that only properties/filters that will produce a result will be displayed.

  • Have each property/filter show the number of results that will be displayed if selected.