Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2004, 02:01 PM
Friend of Wrox
 
Join Date: May 2004
Location: Ardabil, Ardabil, Iran.
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Default error in inline code

hi every one
i need help about if i can use inline code block to write out some variable or not:?
i am examined but i get this error
Code:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<script language="c#" runat="server">

void Page_Load()
      {
    Response.Write("hellow"); 
    string strSql="hhhhh";
    Response.Write(strSql);
      }
</script>
<form runat="server">
<asp:TextBox runat="server" ID="i"></asp:TextBox>
<asp:Button runat="server" ID="submit" Text="insert"></asp:Button>
</form>
<%
Response.Write(strSql);//this line causes this error ->
//CS0103: The name 'strSql' does not exist in the current context

%>
</body>
</html>
what i must to do this .
Thanks in advance.


       YoOrD.
Beauty is not on the face
Beauty is on the heart
~~<<Ghibran Khalil>>~~
__________________
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YoOrD .
Beauty is not on the face
Beauty is on the heart
~~&lt;&lt;Ghibran Khalil&gt;&gt;~~
 
Old November 1st, 2004, 05:13 AM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Chinaboy
Default

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<script language="c#" runat="server">

 string strSql="hhhhh";
void Page_Load()

      {
    Response.Write("hellow");


    Response.Write(strSql);
      }
</script>
<form runat="server">
<asp:TextBox runat="server" ID="i"></asp:TextBox>
<asp:Button runat="server" ID="submit" Text="insert"></asp:Button>
</form>
<%
Response.Write(strSql);//this line causes this error ->
//CS0103: The name 'strSql' does not exist in the current context

%>
</body>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
inline PDF naheedv Pro JSP 3 June 8th, 2007 01:34 AM
Inline Javascript. rupen Javascript How-To 1 July 20th, 2005 12:27 PM
Datagrid error with inline dropdown list hardysmith Classic ASP Basics 0 March 11th, 2005 09:36 AM
Inline Code to Project rodmcleay VS.NET 2002/2003 1 December 14th, 2004 10:38 PM
Discussion: Code-Behind vs. Inline in ASP.Net planoie ASP.NET 1.x and 2.0 Application Design 3 September 20th, 2004 02:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.