我有一個隱藏字段(hdn_vill)在內容的位置持有人它初始化時回發發生但每下拉下選擇更改事件它在hdn_vill中連接相同的值與逗號分開(如: 「2,2,2,2,2」)相同的值在隱藏字段與後續回發
頁面加載事件
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
if (Request.QueryString["vill"] != null)
hdn_vill.Value = (Microsoft.Security.Application.Encoder.HtmlEncode(CommonFunction.TripleDESDecrypt(Request.QueryString["vill"].ToString())).ToString());
}
catch (Exception ex)
{
}
}
}
及以下選定事件更改事件
protected void ddl_Igrs_khata_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddl_Igrs_khata.SelectedIndex > 0)
{
FillOwnerDetail(ddl_Igrs_owner, 0,Convert.ToInt32(Encoder.HtmlEncode(hdn_vill.Value)));
}
}
HiddenField控件
<asp:HiddenField ID="hdn_vill" runat="server" Value="" />
降下來控制
<asp:DropDownList ID="ddl_Igrs_khata" runat="server" Width="100px" Font-Size="16px"
ForeColor="Black" Visible="false" class="" OnSelectedIndexChanged="ddl_Igrs_khata_SelectedIndexChanged"
Height="30px" AutoPostBack="True">
</asp:DropDownList>
填充業主詳細功能
protected void FillOwnerDetail(DropDownList ddl, int flag, string khatano)
{
try
{
LRCBl objlrcbl = new LRCBl();
Checks ch = new Checks();
int count = 0;
if (!ch.IsValidNum(hdn_vill.Value) && !ch.IsValidNum(hdn_areaunit.Value))
{
//DataTable dt = objlrcbl.Usp_Ownership_wise_mutation("Get_owner_Detail_IGRSRahan_Khata", Convert.ToString(Encoder.HtmlEncode(hdn_vill.Value)), "", khatano, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
DataTable dt = objlrcbl.IGRS_RahanamaMut("", 9, Convert.ToInt32(Encoder.HtmlEncode(hdn_vill.Value)), khatano, 0, "", 0, regno);
if (dt.Rows.Count > 0)
{
ddl.DataSource = dt;
ddl.DataTextField = "oname";
ddl.DataValueField = "unique_id";
ddl.DataBind();
count++;
}
if (count > 0 && count < 2)
{
ddl_Igrs_owner.Items.Insert(0, new ListItem("चुने", "0"));
}
}
}
綁定值不糾正檢查值 –
「它已經兩天」可能是形成不良問題的藉口,但它不會幫助您獲得一個答案。休息一下,然後以某種方式提出問題,以便其他人可以清楚地瞭解問題和所需的行爲。不清楚你問的是什麼。 – grek40
它是'網頁形式'嗎? – 2017-04-19 08:05:07