Codebehind tarafı
ddlBusinessLinesL1.Attributes.Add("onchange", "if(!DisableBLPostBack('" & ddlBusinessLinesL1.ClientID & "','" & ddlReportType.ClientID & "')){return false;}")
html sayfaya eklenecek javascript
function DisableBLPostBack(ddlb,rpType)
{
var ddlbus=document.getElementById(ddlb);
var ddl=document.getElementById(rpType);
if (ddl.value==1) 'postback olmasını engellemek istediğim değer 1
{
return false;
}
else
{
return true;
}
}
Control:
<asp:DropDownList ID="ddlBusinessLinesL1" runat="server" Width="155px" AutoPostBack="True">
</asp:DropDownList>