JuiceUI Slider - ValueChanged事件未触发

时间:2012-07-16 09:17:48

标签: juice-ui

我正在尝试在ASP.NET GridView控件中包含一个JuiceUI Slider控件,其中每一行都有一个独特的滑块控件。作为测试,我创建了一个Slider控件:

<juice:slider ID="MasterThresholdSlider" Value="50" Min="0" Max="100" runat="server"
Step="25" ValueChanged="MasterThresholdSlider_ValueChanged"></juice:slider>
<asp:TextBox ID="MasterThresholdText" runat="server"></asp:TextBox>   

现在从我读过的文档中,我可以检测到引发ValueChanged事件时要更改的值。所以在后面的代码中我创建了以下内容:

protected void MasterThresholdSlider_ValueChanged(object sender, EventArgs e)
{
   Juice.Slider slider = (Juice.Slider)sender;

   MasterThresholdText.Text = slider.Value.ToString();
}

由于某种原因,当我运行应用程序时,事件不会触发(断点位于事件的开头)。谁知道我做错了什么?

1 个答案:

答案 0 :(得分:0)

你需要在juice:slider控件中添加AutoPostBack =“true”以启动autopostback。否则,该事件将不会触发,直到页面上的其他内容触发回发。

相关问题