Code
<asp:UpdatePanel ID="MachineUpdate" runat="server" UpdateMode="Conditional">Code
<ContentTemplate>Code
<div id="MachineName" style="">Code
<uc1:MachineNameControl runat="server" ID="MachineNameControl" commandValue="" />Code
</div>Code
</ContentTemplate>Code
</asp:UpdatePanel>Code
My code in MachineNameControl (ascx file)Code
public partial class MachineNameControl : System.Web.UI.UserControlCode
{Code
public String commandValue { get; set; }Code
protected void Page_Load(object sender, EventArgs e)Code
{Code
if (!String.IsNullOrEmpty(commandValue))Code
{Code
this.MachineNameDataSource.WhereParameters.Clear();Code
this.MachineNameDataSource.AutoGenerateWhereClause = false;Code
this.MachineNameDataSource.Where = "it.Head_Id = " + Convert.ToInt32(commandValue) + " ";Code
}Code
else {Code
this.MachineNameDataSource.WhereParameters.Clear();Code
this.MachineNameDataSource.AutoGenerateWhereClause = false;Code
this.MachineNameDataSource.Where = "it.Head_Id > 0 ";Code
}Code
}Code
}Code
Code
My Problem in client side (I've tried to change attribute value of usercontrol and refresh the updatepanel,Code
result is still same and nothing happended)Code
$(function () {Code
$("#<%= MachineNameControl.ClientID %>").attr("commandValue", "2");Code
__doPostBack('<%= MachineUpdate.ClientID %>');Code
}
Nipun Patel6 pointsPosted Feb 11, 2016, 8:17 PM EST
1 short reply
KokLim Tan14 pointsPosted Feb 12, 2016, 2:16 PM EST