首页 \ 问答 \ “数据绑定方法,如Eval(),XPath()和Bind()只能在数据绑定控件的上下文中使用。”(“Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.”)

“数据绑定方法,如Eval(),XPath()和Bind()只能在数据绑定控件的上下文中使用。”(“Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.”)

我在GridView中有5个DropDownLists。 我使用ObjectDataSource绑定网格,并使用5个ObjectDataSources绑定属于GridView的DropDownLists。 一切都很好。 我在C#中捕获了第一个DropDownList SelectedIndexChanged事件,我想绑定第二个DropDownList。 这是我用来绑定第二个下拉列表的代码:

protected void Level1DropdownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList level1List = sender as DropDownList;
            if (level1List != null)
            {
                if (level1List.SelectedValue != "0")
                {
                    // Bind Level 2 List
                    GridViewRow currentRow = AnnouncementLevelsGrid.Rows[AnnouncementLevelsGrid.EditIndex];
                    if (currentRow != null)
                    {
                        DropDownList level2List = currentRow.FindControl("Level2DropdownList") as DropDownList;
                        if (level2List != null)
                        {
                            level2List.DataSource = AnnouncementHelper.GetLevel2(level1List.SelectedValue, EmployerHelper.EmployerID);
                            level2List.DataTextField = "Level2";
                            level2List.DataValueField = "Level2Value";
                            level2List.DataBind();
                        }
                    }
                }
            }
        }

这是asp.net代码示例。

<asp:GridView ID="AnnouncementLevelsGrid" runat="server" Width="99%" DataSourceID="AnnouncementLevelsDataSource"
                                                    CssClass="Grid" AutoGenerateColumns="False" GridLines="None" DataKeyNames="AnnouncementLevelID,AnnouncementId"
                                                    ViewStateMode="Enabled" OnRowCommand="AnnouncementLevelsGrid_RowCommand" OnRowDataBound="AnnouncementLevelsGrid_RowDataBound"
                                                    OnRowUpdating="AnnouncementLevelsGrid_RowUpdating">
                                                    <HeaderStyle CssClass="GridHeader" />
                                                    <RowStyle CssClass="GridRow" />
                                                    <AlternatingRowStyle CssClass="GridAlternating" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Level 1">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level1Label" runat="server" Text='<%# Eval("Level1").ToString() == "0" ? "ALL" : Eval("Level1") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level1DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level1" DataValueField="Level1Value" SelectedValue='<%# Eval("Level1") %>'
                                                                    AutoPostBack="True" DataSourceID="Level1DataSource" OnSelectedIndexChanged="Level1DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 2">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level2Label" runat="server" Text='<%# Eval("Level2").ToString() == "0" ? "ALL" : Eval("Level2") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level2DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level2" DataValueField="Level2Value" SelectedValue='<%# Eval("Level2") %>'
                                                                    AutoPostBack="True" DataSourceID="Level2DataSource" OnSelectedIndexChanged="Level2DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 3">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level3Label" runat="server" Text='<%# Eval("Level3").ToString() == "0" ? "ALL" : Eval("Level3") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level3DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level3" DataValueField="Level3Value" SelectedValue='<%# Eval("Level3") %>'
                                                                    AutoPostBack="True" DataSourceID="Level3DataSource" OnSelectedIndexChanged="Level3DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 4">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level4Label" runat="server" Text='<%# Eval("Level4").ToString() == "0" ? "ALL" : Eval("Level4") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level4DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level4" DataValueField="Level4Value" SelectedValue='<%# Eval("Level4") %>'
                                                                    AutoPostBack="True" DataSourceID="Level4DataSource" OnSelectedIndexChanged="Level4DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 5">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level5Label" runat="server" Text='<%# Eval("Level5").ToString() == "0" ? "ALL" : Eval("Level5") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level5DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level5" DataValueField="Level5Value" SelectedValue='<%# Eval("Level5") %>'
                                                                    DataSourceID="Level5DataSource">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ShowHeader="False">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="EditLink" runat="server" CausesValidation="False" CommandName="Edit"
                                                                    Text="Edit" ToolTip="Edit"><img src="images/edit.png" alt="Edit" style="border-width: 0px;" /></asp:LinkButton>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:LinkButton ID="UpdateLink" runat="server" CausesValidation="True" CommandName="Update"
                                                                    Text="Update" ToolTip="Update"><img src="images/Update-Grd.png" alt="Update" style="border-width: 0px;" /></asp:LinkButton>
                                                                &nbsp;<asp:LinkButton ID="CancelLink" runat="server" CausesValidation="False" CommandName="Cancel"
                                                                    Text="Cancel" ToolTip="Cancel"><img src="images/Cancel-Grd.png" alt="Cancel" style="border-width: 0px;" /></asp:LinkButton>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="10%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <EmptyDataTemplate>
                                                        No Announcements Found.
                                                    </EmptyDataTemplate>
                                                </asp:GridView>
                                                <asp:ObjectDataSource ID="AnnouncementLevelsDataSource" runat="server" SelectMethod="GetAnnouncementLevels"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="AnnouncementLevelsDataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="announcementID" DbType="Int64" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level1DataSource" runat="server" SelectMethod="GetLevel1"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level1DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level2DataSource" runat="server" SelectMethod="GetLevel2"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level2DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc1" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level3DataSource" runat="server" SelectMethod="GetLevel3"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level3DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc2" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level4DataSource" runat="server" SelectMethod="GetLevel4"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level4DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc3" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level5DataSource" runat="server" SelectMethod="GetLevel5"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level5DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc4" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>

当我在网格视图中单击编辑按钮时,所有下拉列表都会以编辑模式呈现它们。 他们也正确地填充数据。 现在当我更改第一个下拉列表项以填充第二个下拉列表项时,它会抛出以下异常:

数据绑定方法(如Eval(),XPath()和Bind())只能在数据绑定控件的上下文中使用。

任何人都可以告诉我如何摆脱这个问题。 我是否需要处理另一个网格事件才能正确绑定下拉列表? 此外,我希望绑定下拉列表后网格行仍处于编辑模式。


I have 5 DropDownLists in GridView. I bind the grid with ObjectDataSource and also bind the DropDownLists that belongs to GridView with 5 ObjectDataSources. Every thing is working fine. I capture first DropDownList SelectedIndexChanged event in C# and i want to bind 2nd DropDownList. Here is the code that i am using to bind second dropdownlist:

protected void Level1DropdownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList level1List = sender as DropDownList;
            if (level1List != null)
            {
                if (level1List.SelectedValue != "0")
                {
                    // Bind Level 2 List
                    GridViewRow currentRow = AnnouncementLevelsGrid.Rows[AnnouncementLevelsGrid.EditIndex];
                    if (currentRow != null)
                    {
                        DropDownList level2List = currentRow.FindControl("Level2DropdownList") as DropDownList;
                        if (level2List != null)
                        {
                            level2List.DataSource = AnnouncementHelper.GetLevel2(level1List.SelectedValue, EmployerHelper.EmployerID);
                            level2List.DataTextField = "Level2";
                            level2List.DataValueField = "Level2Value";
                            level2List.DataBind();
                        }
                    }
                }
            }
        }

Here is the asp.net code sample.

<asp:GridView ID="AnnouncementLevelsGrid" runat="server" Width="99%" DataSourceID="AnnouncementLevelsDataSource"
                                                    CssClass="Grid" AutoGenerateColumns="False" GridLines="None" DataKeyNames="AnnouncementLevelID,AnnouncementId"
                                                    ViewStateMode="Enabled" OnRowCommand="AnnouncementLevelsGrid_RowCommand" OnRowDataBound="AnnouncementLevelsGrid_RowDataBound"
                                                    OnRowUpdating="AnnouncementLevelsGrid_RowUpdating">
                                                    <HeaderStyle CssClass="GridHeader" />
                                                    <RowStyle CssClass="GridRow" />
                                                    <AlternatingRowStyle CssClass="GridAlternating" />
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Level 1">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level1Label" runat="server" Text='<%# Eval("Level1").ToString() == "0" ? "ALL" : Eval("Level1") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level1DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level1" DataValueField="Level1Value" SelectedValue='<%# Eval("Level1") %>'
                                                                    AutoPostBack="True" DataSourceID="Level1DataSource" OnSelectedIndexChanged="Level1DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 2">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level2Label" runat="server" Text='<%# Eval("Level2").ToString() == "0" ? "ALL" : Eval("Level2") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level2DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level2" DataValueField="Level2Value" SelectedValue='<%# Eval("Level2") %>'
                                                                    AutoPostBack="True" DataSourceID="Level2DataSource" OnSelectedIndexChanged="Level2DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 3">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level3Label" runat="server" Text='<%# Eval("Level3").ToString() == "0" ? "ALL" : Eval("Level3") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level3DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level3" DataValueField="Level3Value" SelectedValue='<%# Eval("Level3") %>'
                                                                    AutoPostBack="True" DataSourceID="Level3DataSource" OnSelectedIndexChanged="Level3DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 4">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level4Label" runat="server" Text='<%# Eval("Level4").ToString() == "0" ? "ALL" : Eval("Level4") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level4DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level4" DataValueField="Level4Value" SelectedValue='<%# Eval("Level4") %>'
                                                                    AutoPostBack="True" DataSourceID="Level4DataSource" OnSelectedIndexChanged="Level4DropdownList_SelectedIndexChanged">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Level 5">
                                                            <ItemTemplate>
                                                                <asp:Label ID="Level5Label" runat="server" Text='<%# Eval("Level5").ToString() == "0" ? "ALL" : Eval("Level5") %>'></asp:Label>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:DropDownList ID="Level5DropdownList" runat="server" AppendDataBoundItems="True"
                                                                    DataTextField="Level5" DataValueField="Level5Value" SelectedValue='<%# Eval("Level5") %>'
                                                                    DataSourceID="Level5DataSource">
                                                                    <asp:ListItem Text="All" Value="0"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="18%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="18%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ShowHeader="False">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="EditLink" runat="server" CausesValidation="False" CommandName="Edit"
                                                                    Text="Edit" ToolTip="Edit"><img src="images/edit.png" alt="Edit" style="border-width: 0px;" /></asp:LinkButton>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                                <asp:LinkButton ID="UpdateLink" runat="server" CausesValidation="True" CommandName="Update"
                                                                    Text="Update" ToolTip="Update"><img src="images/Update-Grd.png" alt="Update" style="border-width: 0px;" /></asp:LinkButton>
                                                                &nbsp;<asp:LinkButton ID="CancelLink" runat="server" CausesValidation="False" CommandName="Cancel"
                                                                    Text="Cancel" ToolTip="Cancel"><img src="images/Cancel-Grd.png" alt="Cancel" style="border-width: 0px;" /></asp:LinkButton>
                                                            </EditItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Center" Width="10%" />
                                                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <EmptyDataTemplate>
                                                        No Announcements Found.
                                                    </EmptyDataTemplate>
                                                </asp:GridView>
                                                <asp:ObjectDataSource ID="AnnouncementLevelsDataSource" runat="server" SelectMethod="GetAnnouncementLevels"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="AnnouncementLevelsDataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="announcementID" DbType="Int64" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level1DataSource" runat="server" SelectMethod="GetLevel1"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level1DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level2DataSource" runat="server" SelectMethod="GetLevel2"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level2DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc1" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level3DataSource" runat="server" SelectMethod="GetLevel3"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level3DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc2" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level4DataSource" runat="server" SelectMethod="GetLevel4"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level4DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc3" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>
                                                <asp:ObjectDataSource ID="Level5DataSource" runat="server" SelectMethod="GetLevel5"
                                                    TypeName="LinkManagement.DataAccess.AnnouncementHelper" OnSelecting="Level5DataSource_Selecting">
                                                    <SelectParameters>
                                                        <asp:Parameter Name="employerID" DbType="Int64" />
                                                        <asp:Parameter Name="cc4" DbType="String" />
                                                    </SelectParameters>
                                                </asp:ObjectDataSource>

When i click edit button in grid view, all the dropdownlists render them in edit mode. They are also populating data correctly. Now when i change the first drop down list item in order to populate the second one, it throws the following exception :

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Can any body tell me how can i get rid of this problem. Do i need to handle another event of grid to bind the dropdown correctly? Also i want grid row still in edit mode after binding dropdown.


原文:https://stackoverflow.com/questions/14021874
更新时间:2023-07-25 21:07

最满意答案

您的messageOk方法需要返回一个页面,其中包含一个表单,该表单包含已传递的每个字段的隐藏字段+一个Ok按钮。 所以类似于:

<form method="POST or GET" action="origin url">
  <input type="hidden" name="param1" value="value for param1"/>
  ... for each input ...
  <input type="hidden" name="paramN" value="value for paramN"/>
  <input type=submit" value="Continue"/>
</form>

只要您没有正在上传文件的POST,这应该可以正常工作。 您可能希望在应用程序中考虑更简单的流程,例如仅在有人登录时强制执行此页面。


Your messageOk method will need to return a page with a form that has hidden fields for each field they passed + an Ok button. So something like:

<form method="POST or GET" action="origin url">
  <input type="hidden" name="param1" value="value for param1"/>
  ... for each input ...
  <input type="hidden" name="paramN" value="value for paramN"/>
  <input type=submit" value="Continue"/>
</form>

This should work as long as you don't have a POST that is uploading a file. You might want to consider a simpler flow in your application, like forcing this page only when somebody logs in.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)