Solved

Invalid Character

Posted on 2006-11-02
8
624 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now