你好,我想一個值賦給一個asp.net hiddenfield通過JavaScript發佈之前回來更新過的。asp.net hiddenfield.value不是由JavaScript
但在隱藏fieldValue方法後面的代碼爲空。我使用的代碼是:
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="True" Visible="True">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="save1" EventName="Click">
</asp:AsyncPostBackTrigger>
</Triggers>
<ContentTemplate>
<asp:HiddenField ID="HiddenField1" runat="server" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="save1" runat="server" Text="Send" OnClientClick="return SaveFase();" />
function SaveFase() {
var UP = jQuery.get('<% = HiddenField1.ClientID %>');
UP.Value= "xxxxxxxxxxxxxxxxxxxx"
return true
}
Protected Sub PassBackImage(sender As Object, e As EventArgs) Handles save1.Click
dim Value = HiddenField1.Value
End Sub
This works great $('#<%= HiddenField1.ClientID%>' ).VAL(「XXXXXXXXXXXXXXXXXXXX」); 謝謝你們 – Marky68
@ Marky68無後顧之憂,考慮upvoting這有助於你和接受其最佳/第一回答你的問題的答案的答案。 –