帮助学习asp.net

发布于 2024-10-04 15:13:48 字数 401 浏览 0 评论 0 原文

我目前正在构建一个 ASP.NET 应用程序。它应该非常简单。 问题是,我只体验过 asp.net mvc,对于这个应用程序,我仅限于 .net 2.0,所以没有 mvc。

唯一的要求就是这个。

我有一个包含大约 2000 条记录的表,其中包含以下列: ID、代码 1(唯一)、代码 2(唯一)、姓名、姓氏、电子邮件。

该表已填充 Id、Code1、Code2。

现在,我们的想法是,当有人查找他们的记录(通过 Code1 或 Code2)时,他们可以填写其余字段(姓名、姓氏、电子邮件)。

所以,搜索->如果没有电子邮件、姓名、姓氏,则设置=>编辑=>显示

我需要什么?请帮忙。 我尝试过详细信息视图,但我不确定如何仅在电子邮件字段为空时允许编辑。 我还需要别的东西吗?

I am currently building an asp.net application. Its supposed to be pretty simple.
The problem is, I've only experience with asp.net mvc and for this app I'm limited to .net 2.0 so no mvc.

The only requirement is this.

I have a table of about 2000 records with these columns:
Id, Code1(unique), Code2(unique), Name, LastName, Email.

The table is already populated with Id, Code1, Code2.

Now, the idea is that when someone looks up their record (through Code1 or Code2) they are able to fill the rest of the fields (Name, LastName, Email).

So, search -> if no email, name, lastname set =>edit=>display

What do I need? please help.
I have tried Details View but Im not sure how to allow edit only if the email field is blank.
Do I need something else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

极度宠爱 2024-10-11 15:13:48

我认为最简单的方法如下:

2 个文本框、1 个按钮(搜索)、1 个 GridView、1 个 SqlDataSource。

  1. Gridview 应该连接到 SqlDataSource,而 SqlDataSource 又应该采用 2 个参数(文本框值)
  2. 使用文本框进行搜索,在搜索上单击,GridView.DataBind()
  3. 确保您的 SqlDataSource 指定了 Update 命令

查看 ASP.NET Data 教程了解更多信息,请转到 本教程获取 GridView 更新帮助。

您可以一次编辑 1 条记录,我希望我能为您提供有关设置 Gridview 自动更新的更多详细信息,但自从我使用它以来已经有一段时间了(尽管 Google 应该帮助您解决此问题) )。

I think the easiest way to go is the following:

2 textboxes, 1 button (Search), 1 GridView, 1 SqlDataSource.

  1. Gridview should be hooked up to SqlDataSource, which in turn should take 2 parameters (textbox values)
  2. use textboxes for searching, on Search click, GridView.DataBind()
  3. Make sure your SqlDataSource has the Update command specified

Check out ASP.NET Data tutorials for more info, got to Step 3 in this tutorial for GridView Updating help.

You'd be able to edit 1 record at a time, I wish I could give you more details on setting up the Gridview for automatic Updates, but it's been a while since I've worked with it (Google should help you with this though).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文