Response.write not working...

flostrike

New Member
hi<BR> I am getting the following error :<BR> The server block is not well formed<BR> when i am trying to execute the following code..please help me<BR><BR><%@ Page Language="vb"%><BR><html><BR> <head><BR> <meta name="GENERATOR" content="Microsoft Visual Studio 7.0"><BR> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0"><BR> <script language="vb" runat=server><BR> Sub Page_Load(Sender As Object, Evt As EventArgs)<BR> strhello = "Hello"<BR> End Sub<BR> </script> <BR> </head><BR> <body><BR> <form id="MyFirstAsp" method="Post" action="MyFirstAsp.aspx runat="server"><BR> <%response.write("Mystring=" & strhello)<BR></form><BR> </body><BR></html><BR>A couple things<BR><BR>Why are you using the <FORM> tag? It appears you seem to think you need it just to run .NET. You don't. Get rid of it.<BR>You also do not have a closing %>.<BR><BR>Why don't you do it this way anyway.<BR><BR><HTML><HEAD><BR><script language="vb" runat=server><BR>Sub Page_Load()<BR>strhello.text = "Hello"<BR>End Sub<BR></SCRIPT><BR></HEAD><BR><BR><BODY><BR><asp:label id="strHello" runat="server" /><BR></BODY><BR></HTML><BR><BR>See how easy that is? You can see it in action here.<BR>http://plusasp.com/questions/label.aspx<BR><BR>Rob<BR><BR>You missed the closing %><BR><BR><%response.write("Mystring=" & strhello) <BR><BR>should be:<BR><BR><%response.write("Mystring=" & strhello)%><BR><BR>o <BR><BR>
 
Top