asp:table 中的 asp:Textbox

发布于 2024-09-29 20:16:00 字数 1690 浏览 5 评论 0原文

我正在尝试将 SqlParameter 传递给 SqlDataSourceSqlDataSource 有一个条件 ...Where A.PERS_LNAME = @PERS_LNAME

现在开始配置 SqlDataSource,我单击“配置数据源”并到达“定义参数”步骤。

我选择了 'Parameter Source' = Control,但我根本看不到 的 ID

下拉列表中仅显示 GridViewid

简而言之,我根本看不到 id

这就是我的 > 已定义。

<asp:Table runat="server">
    <asp:TableRow runat="server">
        <asp:TableCell runat="server">Lastname:</asp:TableCell><asp:TableCell runat="server"><asp:TextBox ID="sqlParameterLastname" runat="server"></asp:TextBox></asp:TableCell>
        <asp:TableCell runat="server">Firstname:</asp:TableCell><asp:TableCell  runat="server"><asp:TextBox ID="sqlParameterFirstname" runat="server"></asp:TextBox></asp:TableCell>

   </asp:TableRow>
</asp:Table>

附加信息: 以下两种情况有效,但第三种情况无效。请注意 2 和 2 之间的区别。 3 是我引入了一个额外的列,其中包含 LastName

  1. LastName< ;/asp:TextBox>

你能帮我吗我哪里出错了?或者这样的 ASP 控件嵌入是不允许的吗?

I am trying to pass a SqlParameter to a SqlDataSource.
The SqlDataSource has a condition ...Where A.PERS_LNAME = @PERS_LNAME

Now coming to configuring SqlDataSource, I click on 'Configure Data Source' and reach till the 'Define Parameters' step.

I selected 'Parameter Source' = Control, but I don't see the <asp:Table>'s ID's at all!

Only the GridView's id is shown in the dropdown.

In short, I don't see the <asp:tablecell>'s id at all

This is how my <asp:Table> is defined.

<asp:Table runat="server">
    <asp:TableRow runat="server">
        <asp:TableCell runat="server">Lastname:</asp:TableCell><asp:TableCell runat="server"><asp:TextBox ID="sqlParameterLastname" runat="server"></asp:TextBox></asp:TableCell>
        <asp:TableCell runat="server">Firstname:</asp:TableCell><asp:TableCell  runat="server"><asp:TextBox ID="sqlParameterFirstname" runat="server"></asp:TextBox></asp:TableCell>

   </asp:TableRow>
</asp:Table>

Additional Info:
The following two scenarios work, but the third one doesn't work. Please note that the difference between 2 & 3 is that I have introduced an extra column with a <td>LastName</td>

  1. <asp:TextBox ID="sqlParameterLastname" runat="server">

  2. <table><tr><td><asp:TextBox ID="sqlParameterLastname" runat="server"></asp:TextBox></td></tr></table>

  3. <table><tr><td>LastName</td><td><asp:TextBox ID="sqlParameterLastname" runat="server"></asp:TextBox></td></tr></table>

Can you help me where I am going wrong? Or is such embedding of asp controls not permitted?

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

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

发布评论

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

评论(2

榆西 2024-10-06 20:16:00

您确实可以像您尝试的那样将它们嵌入到表中,但是我从未尝试过像从向导中那样分配 ControlParameter。

此外,我认为您这里有两个不同的问题。

但是,我也觉得您正在尝试执行此页面上显示的操作。此链接是否能为您提供更多见解? https://web.archive .org/web/20211020150717/https://www.4guysfromrolla.com/articles/030106-1.aspx


新想法,概念。使用div来安排布局。是的,你正在做一个基于表格的布局,但是对于 div 来说,它的功能与编译器不同。如果您需要这方面的帮助,请告诉我。这是 Google 出现的示例页面 http://bonrouge.com/~div-table

You can indeed embed them in the table like you're attempting, however I've never tried to assign a ControlParameter like that from the Wizard.

Additionally, I think you have two different questions here.

However, I also feel that you're trying to do what is shown on this page. Does this link offer any more insight for you? https://web.archive.org/web/20211020150717/https://www.4guysfromrolla.com/articles/030106-1.aspx


New idea, concept. Use divs to arrange the layout. Yeah, you're doing a table based layout, but with divs it will function differently to the compiler. If you need help with this, let me know. Here's a sample page that google turned up http://bonrouge.com/~div-table

温馨耳语 2024-10-06 20:16:00

这不起作用,因为这些控件是表控件的子控件。如果您将控件放入 GridView、ListView、Repeaters 等中,也会存在同样的问题。如果网格必须动态生成控件(这里就是这样做的),那么它们在设计时不可用。

如果您有静态表格,那么最好只使用 html 表格元素。

This won't work because the controls are child controls of your table control. The same problem exists if you put controls in GridView's, ListView's, Repeaters, etc.. if the grid has to generate the controls dynamimcally (which it's doing here) then they aren't available at design time.

If you have a static table, you're better off just using html table elements anyways.

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