C# 我可以在Page_Init事件中使用隐藏字段吗?
我想将所选值存储在隐藏字段中,并在C# 我可以在Page_Init事件中使用隐藏字段吗?,c#,jquery,asp.net,C#,Jquery,Asp.net,我想将所选值存储在隐藏字段中,并在Page_Init事件(代码隐藏)上使用, 实际上,我可以将所选值存储在隐藏字段中,但无法进入Page\u Init事件。是否有任何方法可以实现同样的效果 ASPX $('#ddlRegion').change(function (e) { $('#hdnRegionCode').val(this.value); }); .cs //location if (hdnRegionCode.
Page_Init
事件(代码隐藏)上使用,
实际上,我可以将所选值存储在隐藏字段中,但无法进入Page\u Init
事件。是否有任何方法可以实现同样的效果
ASPX
$('#ddlRegion').change(function (e) {
$('#hdnRegionCode').val(this.value);
});
.cs
//location
if (hdnRegionCode.Value != "")
{
ServiceReference1.LOCATION[] location = oClient.GetLocations(hdnRegionCode.Value, "1000", null);
dgDepots.DataSource = location;
dgDepots.KeyFieldName = "LocationCode";
((GridViewDataComboBoxColumn)dgDepots.Columns["LocationCode"]).PropertiesComboBox.DataSource = location;
}
隐藏字段
<asp:HiddenField ID="hdnRegionCode" runat="server" ClientIDMode="Static" />
有人能帮我吗
Thanx无论如何,您可能不需要使用
Page\u Init
。你在里面干什么?我想你把Page_Init
和document搞混了。准备好了吗?@VDWWD实际上我正在使用Page_Init上的WebServices绑定网格视图中的下拉列表event@Shree是的,可能是。你能给我提个建议吗same@VDWWD我应该在页面加载时绑定下拉列表吗?或者我应该绑在哪里?请帮助我您可能不需要使用Page\u Init
。你在里面干什么?我想你把Page_Init
和document搞混了。准备好了吗?@VDWWD实际上我正在使用Page_Init上的WebServices绑定网格视图中的下拉列表event@Shree是的,可能是。你能给我提个建议吗same@VDWWD我应该在页面加载时绑定下拉列表吗?或者我应该绑在哪里?请帮帮我