将WizardSteps控件中的隐藏域值传递到下一个站点 [英] Pass hiddenfield value within a WizardSteps control to next site
问题描述
我在提交时向下一个网站发送值时遇到了一些问题。我认为问题在于hiddenfield被放置在WizardSteps控件中,但我不知道。
Im having some problems with sending a value to the next site on a submit. I think the problem is that the hiddenfield is placed inside a WizardSteps control, but i dont know.
以下是html代码:
<asp:WizardStep runat="server" ID="Complete" Title="Trin 4" OnActivate="OnLoad_Step4">
<div class="OrderComfirmation">
<div class="personInformation">
<div class="title">Dine oplysninger <span class="personInformationParanthes">( </span><a href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$Content$Wizard1$SideBarContainer$SideBarList$ctl02$SideBarButton', '', true, '', '', false, true))">ret</a> <span class="personInformationParanthes">) </span></div>
<div class="personalInformationLabel"><asp:Label ID="PersonInformationLabel" runat="server" Text="Label"></asp:Label></div>
</div>
<div class="cartList">
<div class="cartListTitle">Indkøbskurv</div>
<div class="cartListContent">
<table>
<tr>
<td class="cartListTdTitleProduct">Produkt</td>
<td class="cartListTdTitleQuantaty">Antal</td>
<td class="cartListTdTitlePrice">Stk. Pris</td>
<td class="cartListTdTitlePriceTotal">Pris</td>
<td class="cartListTdTitleDelete">Slet</td>
</tr>
<asp:DataList ID="OrderConfirmationList" runat="server"
OnItemDataBound="OrderConfirmationList_ItemDataBound">
<ItemTemplate>
<tr>
<td class="cartListTdContentProduct"><%# Eval("Produkt") %></td>
<td class="cartListTdContentQuantaty">
<asp:Label ID="AmountLabel" runat="server" Text="Label"></asp:Label>
</td>
<td class="cartListTdContentPrice">
<asp:Label ID="ProductPriceLabel" runat="server" Text='<%# Eval("Pris") %>'></asp:Label>,00 DKK
</td>
<td class="cartListTdContentPriceTotal">
<asp:Label ID="PriceLabel" runat="server" Text="Label"></asp:Label>,00 DKK
<asp:Label ID="ProductIDLabel" Visible="false" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label>
</td>
<td class="cartListTdContentDelete"><a href="test.aspx?productID=<%# Eval("ProductID") %>">Slet</a></td>
</tr>
<tr>
<td class="cartListLine" colspan="5"></td>
</tr>
</ItemTemplate>
</asp:DataList>
<tr>
<td>
<div class="cartListTdContentTotal">
<div>69,00 DKK</div>
<div><asp:Label ID="OrderConfirmationTotalPriceLabel" runat="server" Text="Label"></asp:Label>,00 DKK</div>
<div><asp:Label ID="OrderConfirmationMomsLabel" runat="server" Text="Label"></asp:Label> DKK</div>
</div>
<div class="cartListTdContentTotalText">
<div>Fragt</div>
<div>Total inkl. moms</div>
<div>Heraf moms</div>
</div>
</td>
</tr>
</table>
<asp:HiddenField ID="amount" Value='99999' runat="server" />
</div>
</div>
</div>
</asp:WizardStep>
这里是我尝试从隐藏字段中获取值的代码:
And here is the code where i try to catch the value from the hiddenfield:
Label1.Text = "Tester: " + Request.Form["amount"]+"<br />";
推荐答案
过去我们使用HiddenField服务器MultiView和Wizard控件模板中的控件。它似乎没有保留回传的价值,但不幸的是我不知道背后的原因。
We've had problems in the past using HiddenField server controls within MultiView and Wizard control templates. It doesn't seem to hold the value across postbacks, but unfortunately I don't know the reasons behind that.
另一个选择是否要存储值而页面数据将保存在隐藏的TextBox中。
Another option to consider if you want to store the value with the page data is to hold the value in a hidden TextBox instead.
这篇关于将WizardSteps控件中的隐藏域值传递到下一个站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!