次のWebページがあります。
<input id="ColourPicker" type="text" value="000000" />
<asp:Label ID="ColourChosen" runat="server" Text="000000" ClientIDMode="Static"></asp:Label>
これらは jPicker にバインドされています。
$(document).ready(
function () {
$('#ColourPicker').jPicker(
{
images: { clientPath: 'Scripts/images/' },
window: { position: { x: '25', y: '0' }, expandable: true }
},
function(color) {
var all = color.val('all');
document.getElementById('ColourChosen').innerHTML = all.hex;
});
});
jPicker で色を選択して [OK] をクリックすると、ブラウザーに次のように表示されます。
左側のボックスは ColourPicker で、右側のラベルは ColourChosen です。
ページ ソースを表示すると、次のように表示されます。
<input id="ColourPicker" type="text" value="000000" />
<span id="ColourChosen">000000</span>
私はこれのいくつかのコードビハインドを持っています:
protected void Button1Click(object sender, EventArgs e)
{
var l = new List<Borg.PlotColurs> {new Borg.PlotColurs()};
l[0].PlotColour = ColourChosen.Text;
Borg.BulkInsert(ConfigurationManager.ConnectionStrings["utilConnectionString"].ConnectionString, "PlotColours", l);
ListView2.DataBind();
}
ColourChosen.Text を f41313 に等しくしたいのですが、常に 000000 に等しくなります。
私は何を間違っていますか?