Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp.net, javascript, too many chars

Status
Not open for further replies.

sds814

Programmer
Feb 18, 2008
164
US
A property in my user control is setting the width of a panel to a hidden field, and then using javascrip the hidden field is setting the width of the panel. Here is the code for the latter part:

Code:
<asp:Panel id="Paneltest" runat="server" OnLoad="javascript: SetWidth('<%=Paneltest.ClientID%>')"></asp:Panel>

function SetWidth(panelID)
{
    var panel = $get(panelID);
    panel.style.width = document.getElementById("hfModalWidth").Value;
}


Error is: "Too many characters in character literal"
I believe the error is with: OnLoad="javascript: SetWidth('<%=Paneltest.ClientID%>')", but I can't figure out the correct syntax.

Thanks for the help.
 
If you're having errors with your client-side code, can you post your client-side code? If it's an error with your .Net, you should ask in the .Net forums.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
the code that I have posted above is the client-side code. please let me know what other code you would like me to post. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top