Solved

Invalid Character

Posted on 2006-11-02
8
635 Views
Last Modified: 2013-12-03
I migrated an asp.net application from 1 server to another. Now on one of the pages i am getting  a 'invalid character' error on some javascript generated by the asp. Ive checked versions..and both the same.  
Basically it is a little piece of javascript that when you click the down arrow and choose a value - it is supposed to fill in the next drop down. on loading the page it is fine-then when you push the down arrow - it errors out the IE Browser with Error: Invalid Character, line 1, char 2.

Much help is needed! Ive been working on this for days..

This is the code:

<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >-->
<HTML>
      <HEAD>
            <title>Associate User To Entity</title>
            <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
            <meta content="C#" name="CODE_LANGUAGE">
            <meta content="JavaScript" name="vs_defaultClientScript">
            <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
            <LINK href="/CBF/CSS/CBF.css" rel="stylesheet" type="text/css">
            <SCRIPT language="vbscript" type="text/vbscript">

   <!--

   Sub ClientValidateOnAdd(source, arguments)
           
      If Len(Trim(source)) = 0 Then
         arguments.IsValid=False
      Else
         arguments.IsValid=True
      End If

   End Sub

   -->

            </SCRIPT>
      </HEAD>
      <body>
            <form name="Entities" method="post" action="AssociateUserToEntityAndReportType.aspx" id="Entities">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTIxMzI1NTI5ODAPZBYCAgEPZBYGAgMPEA8WAh4LXyFEYXRhQm91bmRnZBAVDAEgCUFsYW1vd2luZwVMZWdhbAVPdGhlcgVSICYgSApSZWFsZXN0YXRlBVJpb2NvB1Jpb3dpbmcHUm9ja2llcwlTYW5kcG9pbnQKU3RhbXBjcmV0ZQtUZXN0IEVudGl0eRUMATACNTcCNTgCNTUCNTkCNTICNTQCNDUCNDkCNTMCNTACNDMUKwMMZ2dnZ2dnZ2dnZ2dnFgFmZAIFDxBkZBYAZAIHDzwrAAsAZGTnAT0fYY6tARUmptLJ2aninXdpGg==" />
</div>

<script type="text/javascript">
<!--
var theForm = document.forms['Entities'];
if (!theForm) {
    theForm = document.Entities;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
      //setTimeout("_doPostBack()", 1000);
}
// -->
</script>


<table id="Table1" cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
            <td width="1%"><img src="/CBF/Images/banner-left.gif" border="0"></td>
            <!--<td width="98%" background="/CBF/Images/banner-mid-bg.gif"></td>-->
            <td width="98%"><img src="/CBF/Images/banner-mid-bg.gif" width="100%" height="20"></td>
            <td><img src="/CBF/Images/banner-right.gif"></td>
      </tr>
</table>
<table height="40" cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
            <td valign="top" align="left" width="1%" height="27"><img src="/CBF/Images/top-left.gif"></td>
            <td width="98%" height="27"><font class="clsFunctionalArea">Associate User to Entity</font></td>
            <td width="1%" height="27"><table height="17" cellspacing="0" cellpadding="0" border="0">
                        <tr>
                              <td width="10"><img height="20" src="/CBF/images/menu-top-left.gif" width="10"></td>
                              <td align="center" bgcolor="#336699" nowrap><font face="Verdana" size="2" color="#fffff">CBF Administrator : Friday, October 27, 2006 - CST</font>&nbsp;</td>
                        </tr>
                  </table>
            </td>
      </tr>
</table>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
            <td width="1%" valign="top"><table cellspacing="0" cellpadding="3" width="170" border="0"><tr><td class=clsMenuHeader>Reports</td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="ReportSelection.aspx">Run Reports</a></td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="SystemReports.aspx">System Reports</a></td></tr><tr><td><br></td></tr><tr><td class=clsMenuHeader>Maintenance</td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="MaintainUsers.aspx">Users</a></td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="MaintainEntities.aspx">Entities</a></td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="MaintainReportTypes.aspx">Report Types</a></td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="AssociateUserToEntityAndReportType.aspx">Associations</a></td></tr><tr><td class=clsMenuItem><a class=clsMenuItem href="MaintainReports.aspx">Reports</a></td></tr><tr><td><br></td></tr><tr><td class=clsMenuHeader><a class=clsMenuHeader href=".\Default.aspx">Log Off</a></td></tr></table></td>
            <td valign="top" align="left" width="96%" class="clsStandardText"><br>
                  
                  
                  
                  
                  <P><STRONG>
                              <BR>
                              Select an Entity:</STRONG>
                        <select name="ddlEntity" onchange="javascript:setTimeout('__doPostBack(\'ddlEntity\',\'\')', 0)" id="ddlEntity" style="font-size:XX-Small;">
      <option selected="selected" value="0"> </option>
      <option value="58">Legal</option>
      <option value="55">Other</option>
      <option value="59">R &amp; H</option>
      <option value="52">Realestate</option>
      <option value="43">Test Entity</option>

</select></P>
                  
        <P><STRONG>Select a Report Type:</STRONG>
          <select name="ddlReportTypes" onChange="javascript:setTimeout('__doPostBack(\'ddlReportTypes\',\'\')', 0)" id="ddlReportTypes" style="font-size:XX-Small;">
          </select>
        </P>
                  <P>
                        <TABLE id="Table1" style="WIDTH: 644px; HEIGHT: 20px" cellSpacing="1" cellPadding="1" width="644"
                              border="0">
                        </TABLE>
                  </P>
                  <STRONG>Check the Associated Beneficiaries:</STRONG><BR>
                  <BR>
                  <HR class="#c7ccdc" width="100%" SIZE="1">
                  <P align="center"><input type="submit" name="btnSave" value="Save" id="btnSave" class="Button" />&nbsp;
                        <input type="submit" name="btnCancel" value="Cancel" id="btnCancel" class="Button" /></P>
                  &nbsp;
</td> </tr> </table>
<div>

      <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWEQLz5svFBgKF+dSmDAKVlv5IAo6WmksCjpbeSAKOloJLAo6W0kgCjpa2SwKOlo5LAomWgksCiZbSSAKOlopLAo6WvksCiZaKSwKf1ODCDgKct7iSDAKQ9M/rBR4iU39h7E+dCjpohXaD7tVjg3PY" />
</div></form>
      </body>
</HTML>
0
Comment
Question by:renet123
  • 4
  • 2
  • 2
8 Comments
 
LVL 54

Assisted Solution

by:b0lsc0tt
b0lsc0tt earned 334 total points
ID: 17862887
renet123,

Try changing the first line.  You should not comment out the doctype line and it seems like that is where the error is occurring.  Change the first line in the code you provided to the line below.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 54

Assisted Solution

by:b0lsc0tt
b0lsc0tt earned 334 total points
ID: 17862908
Most current browsers actually like this version of that line better.  In this case it displays on 2 lines just as you see below (i.e. not wrapped).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
0
 

Author Comment

by:renet123
ID: 17863264
i took the 'comment out' and tried both of these methods.. and i am getting the same error. i think that it has something to do with the javascript - because the error occurs when i push the selection box and choose an option.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Accepted Solution

by:
yasir710 earned 166 total points
ID: 17893259
Yes, you are right. The problem is with the javascript and this is what I have found wrong in your code.

onChange="javascript:setTimeout('__doPostBack(\'ddlReportTypes\',\'\')', 0)"

You have forgotten to add \ to the last (single quote) ' for the first parameter of setTimeout.

The above onChange code should be:

onChange="javascript:setTimeout('__doPostBack(\'ddlReportTypes\',\'\')\', 0)"

See if this works for you.

Yasir
0
 

Author Comment

by:renet123
ID: 17894278
ok. so i apreciate the help - and i will spread points out evenly because i apreciate the help - and i beleive that these forums should continue.  
This morning i solved this issue on my own.  If you look at my original post - i told everyone that i migrated the whole asp.net application.   Well - i migrated from a server using asp.net 1.1 to a server using asp.net 2.0.  Thankfully - asp.net can run both versions side by side - and i ran this particular application under the 1.1 instead of 2.0.
Just an FYI - the way you do this in IIS 6.0 is right click the app/web, go to the asp.net tab, and hit the drop down from 2.0 to 1.1 (you may have to install 1.1 if its not in the drop down-not sure) - then click apply - and maybe a stop-start on the website.. and it all worked after that.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17894329
I'm glad that I was able to help.  Thanks for letting us know the result.  Also thank you for the grade, the points and the fun question.

bol
0
 

Expert Comment

by:yasir710
ID: 17895547
It was my first answer to any of the forums here on EE and I am pleased that my effort has been greatly appreciated.

Yasir
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17899475
@Yasir - Congratulations and welcome!

bol
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question