what the heck?!?!?!?

P

Paul W

ok - I've pissed away a morning on this. I keep getting a 'Server Tag is not
well formed' error on a page. I have simplified the page to the point of
ridiculous - and it still fails. The problem is related to the assignment to
'bightml2' in the JS.

If I change it to read "...runat="qqqqqq" then it works, but
"...runat="server" fails!!!!!

PLEASE can someone point me in the right direction?

Paul.
--
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="ScheduleA.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/nav4-0"><script
language=javascript>
<!--
function testit(){


var bightml2
bightml2='style="WIDTH: 24px"type="text" size="1" value="1" name="txtNumber"
runat="server">'
alert (bightml)

}

//-->
</script>

</head>
<body MS_POSITIONING="FlowLayout">

<form id="Form1" method="post" runat="server">

</form>

</body>
</html>
 
B

BillGatesFan

This does not look right.

bightml2='style="WIDTH: 24px"type="text" size="1" value="1"
name="txtNumber"

There are extra quotes
 
E

Eric Newton

you probably need to get the asp.net parser to stop looking at the literal
JS string.

Do that by breaking it up, and besides it doesn't make sense to output
"runat=server" on client side code!
 
B

Bruce Barker

when asp.net parses the html if it sees a runat=server, it expects to be
inside a valid tag. in this case its not so it gives the error. the fix is:

var bightml2 ='style="WIDTH: 24px"type="text" size="1" value="1"
name="txtNumber"
runat' + ' ="server">'

of course javascrip emitted html is only processed by the browser, so
runat=server is meanless. so you could just use:

var bightml2 ='style="WIDTH: 24px"type="text" size="1" value="1"
name="txtNumber" >'

-- bruce (sqlwork.com)
 
P

Paul W

Thanks,

Paul.
Bruce Barker said:
when asp.net parses the html if it sees a runat=server, it expects to be
inside a valid tag. in this case its not so it gives the error. the fix
is:

var bightml2 ='style="WIDTH: 24px"type="text" size="1" value="1"
name="txtNumber"
runat' + ' ="server">'

of course javascrip emitted html is only processed by the browser, so
runat=server is meanless. so you could just use:

var bightml2 ='style="WIDTH: 24px"type="text" size="1" value="1"
name="txtNumber" >'

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top