Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,533 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,786 people online right now. Registration is fast and FREE... Join Now!




Labels in ASP.Net

 
Reply to this topicStart new topic

Labels in ASP.Net, Trying to get lblCounter's to show up and get some output to the f

everest_01
16 Aug, 2008 - 11:26 AM
Post #1

New D.I.C Head
*

Joined: 16 Aug, 2008
Posts: 1

CODE

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1"%>
<%@ Import Namespace="System.IO" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
    <script language="VB" runat="server">

Sub Page_Load(Sender as object, E as EventArgs)
dim fs as new FileStream(Server.MapPath("counter.txt"),FileMode.Open,FileAccess.Read)
dim objReader as new StreamReader(fs)
objReader.close()
fs.close
dim objWriter as new StreamWriter(Server.MapPath("counter.txt"),true)
objWriter.WriteLine("Hi There")


objWriter.close()

lblCounter2.Text="Good Afternoon"
lblCounter3.Text="Good Evening"
End Sub
</script>
        <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/ie5">
    </HEAD>
    <body BGCOLOR="#55666" TEXT="#ffffcc" LINK="#cc9600" ALINK="#cc6600" VLINK="#969696" MS_POSITIONING="GridLayout">
                <asp:Label id="lblCounter" style="Z-INDEX: 107; LEFT: 744px; POSITION: absolute; TOP: 680px"
            runat="server" />
                <        <asp:Label ID="lblCounter2" Runat=server />
        <asp:Label ID="lblCounter3" Runat="server" />
    </body>
</HTML>


Mod Edit: Please use code tags when posting your code. Code tags are used like so => code.gif

Thanks,
PsychoCoder smile.gif
Note: I eliminated all of the code that works. I am trying to populate er, lblCounter2 and lblCounter3 with "Good AfterNoon and Good Evening. It is not working
Also
I am trying to write to the file counter.txt which is the same directory as the aspx page and that is not working.
There are no error messages

This post has been edited by everest_01: 16 Aug, 2008 - 11:58 AM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Labels In ASP.Net
16 Aug, 2008 - 11:31 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,996



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:

  • Post the code you're having problems with √
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do

User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 10:11PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month