I have a html page with some code like
<div style="background-color: rgb(191, 122, 111);">
function Gettbgcolor(obj)
{
var bgcolor = obj.style.backgroundColor;
parent.GetLayoutbackgroundcolor(bgcolor);
}
I used iframe into .aspx page and calling this html page into i frame.
And i have another page name home.aspx and i want call this value into .aspx.cs.
and i am using this code in home.aspx page
function GetLayoutbackgroundcolor(bgcolor)
{
form1.hdColorSchemaBackground.value = bgcolor;
alert(form1.hdColorSchemaBackground.value);
}
hdColorSchemaBackground is asp hiddenfield but its not get the value of bg color
how can i do this
ASP.NET chooses its own
idandnameattributes for hidden inputs created with the<asp:HiddenField>tag. That’s why your JavaScript won’t set the field’s value.You can do something like this instead:
That will insert the correct (client-side) id value for your javascript.