Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best Practice Question on Var Display

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
I have a best practice question.
I have company declared on the code behind page as Public.
I want it to display in a table (not built yet) on my script page. Is it still acceptable to use the response.write("") like <%=company%> which works fine or should the var be placed in a container like a TB or Lable?


Thanks

Code:
<script language="vbscript" runat="server">
    Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim drbol As SqlDataReader
        Dim sqlbol As String = ClSql.getsql("bol", "2009020300552")
        drbol = getmiscdata.getdata(sqlbol)
        While drbol.Read
            company = (drbol(2))
        End While
    End Sub
    
</script>
</head>
<body>

    <form id="form1" runat="server">
    <div>

    <%=company%>
        
    </div>
    </form>
</body>
 
You can still use the script tags, but that is considers classic ASP style of programming. I would write the value to a lable or literal control from the codebehind. This will also help in debugging.
 
Ha Thats where I started in the code behind. I was just testing out some things on a script page. Trying to make life hard for myself. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top