In the C# code I want conditionally store reference to an object to a literal executed in a JavaScript .
Example one works:
<script language="JavaScript">
function setFocusIfNeeded()
{
document.all('atMyDropDownList').focus()
}
</script>
<body onload="setFocusIfNeeded();">
Example two is where I want store reference of “document.all('atMyDropDownList').focus()” to ltlScript:
<script language="JavaScript">
function setFocusIfNeeded()
{
<asp:literal id="ltlScript" runat="server" />
}
</script>
<body onload="setFocusIfNeeded();">
My way of thinking one line of C# code should handle this. I have tried many variations with no success. Any help will be greatly appreciated!
Thank you!
iRead
Example one works:
<script language="JavaScript">
function setFocusIfNeeded()
{
document.all('atMyDropDownList').focus()
}
</script>
<body onload="setFocusIfNeeded();">
Example two is where I want store reference of “document.all('atMyDropDownList').focus()” to ltlScript:
<script language="JavaScript">
function setFocusIfNeeded()
{
<asp:literal id="ltlScript" runat="server" />
}
</script>
<body onload="setFocusIfNeeded();">
My way of thinking one line of C# code should handle this. I have tried many variations with no success. Any help will be greatly appreciated!
Thank you!
iRead