I am running into an issue with running javascript from an external javascript file inside of an UpdatePanel. I am trying to get a color picker working inside of a ListView. The ListView is inside of an UpdatePanel.
I am using this color picker.
Here is what I have narrowed it down to:
If I use the color picker on a textbox outside of an
UpdatePanel
, it works perfectly fine through all postbacks.If I use the color picker on a textbox inside of an
UpdatePanel
, it works, until I do an async postback(clicking on an "EDIT" button in the ListView). Once theUpdatePanel
has done the postback, the textbox will no longer show the color picker when clicked. The same occurs when the textbox is in either theInsertItemTemplate
orEditItemTemplate
of the ListView.
If you would like to replicate it, simply download the color picker(it's free), then add this to a webpage...
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="panel1" runat="server">
<ContentTemplate>
<asp:TextBox runat="server" ID="textbox" CssClass="color" />
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
When the page loads, the color picker works fine. When you click on the button(which does a postback), the color picker will no longer work.
Any ideas?