Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 November 17th, 2003, 04:42 PM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default aspx page only displays lable boxes

I'm using visual studio to write a simple email form. Everything compiles fine, but when i preview in the browser, the only thing that displays is the label boxes. The text boxes and submit button are hidden and i can't seem to get them to show.

I appreciate any help.



 
Old November 17th, 2003, 04:49 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can you post some code?

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 17th, 2003, 05:14 PM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imports System.Web.Mail

Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected WithEvents lblName As System.Web.UI.WebControls.Label
    Protected WithEvents lblSeat As System.Web.UI.WebControls.Label
    Protected WithEvents lblNewName As System.Web.UI.WebControls.Label
    Protected WithEvents lblStartDate As System.Web.UI.WebControls.Label
    Protected WithEvents txtSeat As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtNewName As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtStartDate As System.Web.UI.WebControls.TextBox
    Protected WithEvents lblSender As System.Web.UI.WebControls.Label
    Protected WithEvents txtSender As System.Web.UI.WebControls.TextBox
    Protected WithEvents cmdSubmit As System.Web.UI.WebControls.Button

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

    End Sub

    Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
        'Create the message
        Dim msg As New MailMessage()
        msg.To = "[email protected]"
        msg.Subject = "New Employee Ticket"
        msg.Body = "Submitted By:" & txtSender.Text & Chr(10)
        msg.Body &= "Seat #:" & txtSeat.Text
        msg.Body &= "New Employee Name:" & txtNewName.Text & Chr(20)
        msg.From = txtSender.Text

        'Send the message
        SmtpMail.Send(msg)

    End Sub

End Class

 
Old November 17th, 2003, 05:56 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

There's nothing in your code-behind that looks abnormal.

What about the markup?

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 17th, 2003, 06:03 PM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the only line highlighted in the html is

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="NewEmp.aspx.vb" Inherits="WebApplication1.WebForm1"%>

is that what you are meaning behind markup?

 
Old November 17th, 2003, 06:10 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Markup is everything in the aspx file (vs. codebehind which is the aspx.vb).

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 17th, 2003, 08:08 PM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, thank you for clearing that up for me. I'm rather new at all of this.

this is what my aspx displays

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="NewEmp.aspx.vb" Inherits="WebApplication1.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <title>New Employee Ticket</title>
        <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
        <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout" bgColor="#2fb6a2">
        <form id="Form1" method="post" runat="server">
            <asp:Label id="lblName" style="Z-INDEX: 101; LEFT: 190px; POSITION: absolute; TOP: 36px" runat="server" Width="139px" Height="21px">New Employee Ticket</asp:Label>
            <asp:TextBox id="txtSender" style="Z-INDEX: 110; LEFT: 291px; POSITION: absolute; TOP: 77px" runat="server"></asp:TextBox>
            <asp:Button id="cmdSubmit" style="Z-INDEX: 108; LEFT: 228px; POSITION: absolute; TOP: 269px" runat="server" Text="Submit"></asp:Button>
            <asp:TextBox id="txtStartDate" style="Z-INDEX: 107; LEFT: 291px; POSITION: absolute; TOP: 206px" runat="server"></asp:TextBox>
            <asp:TextBox id="txtNewName" style="Z-INDEX: 106; LEFT: 291px; POSITION: absolute; TOP: 164px" runat="server"></asp:TextBox>
            <asp:TextBox id="txtSeat" style="Z-INDEX: 105; LEFT: 291px; POSITION: absolute; TOP: 121px" runat="server"></asp:TextBox>
            <asp:Label id="lblStartDate" style="Z-INDEX: 104; LEFT: 92px; POSITION: absolute; TOP: 211px" runat="server">Start Date</asp:Label>
            <asp:Label id="lblNewName" style="Z-INDEX: 103; LEFT: 96px; POSITION: absolute; TOP: 160px" runat="server">New Employee Name</asp:Label>
            <asp:Label id="lblSeat" style="Z-INDEX: 102; LEFT: 100px; POSITION: absolute; TOP: 119px" runat="server">Seat #</asp:Label>
            <asp:Label id="lblSender" style="Z-INDEX: 109; LEFT: 99px; POSITION: absolute; TOP: 80px" runat="server" Width="132px" Height="16px">Person Sending Form</asp:Label>
        </form>
    </body>
</HTML>


 
Old November 17th, 2003, 10:10 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Everything there looks ok as well. Can't imagine why you aren't seeing the text boxes and button. Have you looked at the rendered source code to see that something is actually coming out?

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 18th, 2003, 10:29 AM
Registered User
 
Join Date: Nov 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes i have, it runs fine, but the formatting is all wrong. It only displays the label boxes, one right next to the other, in one long line across the top of the page.

Am i missing a declaration at the top of the code or something?
Something more than webcontrols?

i appreciate your effort!

-kim

 
Old November 18th, 2003, 12:06 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ok, now I'm a little confused.

Is your problem that things aren't showing up? Or are they not formatting correctly? What browser are you using? You are using grid layout on your form, and this *might* cause problems with other browsers. I don't know what .Net does when it detects other browsers requesting a form that is using grid layout. I always use flow layout. IMHO you should always use flow layout as this caters to the nature of the medium. I think it provides for the least incompatibility between browsers.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 displays a blank page... thomasdrago XML 1 January 23rd, 2008 10:01 PM
How to pass variables from Aspx page to Asp Page jayaraj Classic ASP Basics 2 May 23rd, 2004 06:56 AM
How to pass the variables in Aspx page to Asp Page jayaraj ASP.NET 1.0 and 1.1 Basics 3 May 23rd, 2004 06:55 AM





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