Hi, my working with my registration web application. Here my code.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 47%;
            height: 169px;
        }
        .style2
        {
            font-size: large;
            color: #0000FF;
            font-weight: bold;
            font-family: "Berlin Sans FB";
            text-transform: uppercase;
            text-align: center;
        }
        .style3
        {
            font-family: "Trebuchet MS";
            font-size: small;
            font-weight: bold;
        }
        .style6
        {
            height: 13px;
        }
        .style7
        {
            font-family: "Trebuchet MS";
            font-size: small;
            font-weight: bold;
            width: 79px;
        }
        .style8
        {
            height: 13px;
            width: 79px;
        }
        .style9
        {
            font-family: "Trebuchet MS";
            font-size: small;
            font-weight: bold;
            width: 240px;
        }
        .style10
        {
            width: 240px;
        }
        .style11
        {
            height: 13px;
            width: 240px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    </div>
    <table class="style1">
        <tr>
            <td class="style2" colspan="3">
                Registration Form</td>
        </tr>
        <tr>
            <td class="style7">
                Username</td>
            <td class="style9">
                <asp:TextBox ID="UserName" runat="server" Font-Names="Malgun Gothic" 
                    Height="25px" Width="237px"></asp:TextBox>
            </td>
            <td class="style3">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="Required" Font-Bold="False" Font-Names="Calisto MT"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style7">
                Password</td>
            <td class="style10">
                <asp:TextBox ID="Password" runat="server" Font-Names="Malgun Gothic" 
                    Height="25px" Width="237px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ErrorMessage="Required" Font-Bold="False" Font-Names="Calisto MT" 
                    Font-Size="Small"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style7">
                Confirm<br />
                Password</td>
            <td class="style10">
                <asp:TextBox ID="ConfirmPassword" runat="server" Font-Names="Malgun Gothic" 
                    Height="25px" Width="238px"></asp:TextBox>
            </td>
            <td>
                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                    ErrorMessage="Password do not match"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td class="style7">
                Email</td>
            <td class="style10">
                <asp:TextBox ID="Email" runat="server" Font-Names="Malgun Gothic" Height="25px" 
                    Width="240px"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ErrorMessage="Required" Font-Bold="False" Font-Names="Calisto MT" 
                    Font-Size="Small"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ErrorMessage="RegularExpressionValidator"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style8">
            </td>
            <td class="style11">
                <asp:Button ID="Submit" runat="server" Font-Bold="True" Font-Names="Calibri" 
                    Font-Overline="False" Text="Submit" />
            </td>
            <td class="style6">
                 </td>
        </tr>
    </table>
    </form>
</body>
</html>

After trying to build, I found an error [ 'Context' is not a member of '_Default'.] and 26 more error. This error show in this link http://tinypic.com/view.php?pic=2130w47&s=8#.VP6qsPmUd1Y Anyone here can help me to solve this problem?

Recommended Answers

All 4 Replies

Hi

This error usually indicates that your partial class is not named correctly for some reason.

Usually, when you have a web form there are two files:

Default.aspx - this is your designer file that contains the HTML etc.
Default.aspx.vb -this is your code behind file that contains your server side code.

The Default.aspx.vb is a partial class which should be declared like:

Partial Class _Default
    Inherits System.Web.UI.Page

End Class

When compiled, the two files are effectively merged together. It seems in your situation that your partial class is not called _Default.

Open Default.aspx.vb and make sure that it's class name corresponds to your markup file, that is, it states _Default.

HTH

djjeavons,

In this program, I didn't write any code to default.aspx.vb yet and only just doing some design which is drag the textbox, label,RequiredFieldValidator,Compare validator and other.

My UI : http://i58.tinypic.com/2jdp0lx.png

I want to build and debug it, but after build. Some sort of error occur as I mention above.

Its mean, I can't run my program if I didn't write the default.aspx.vb ?

Hi

Does the default.aspx.vb file exist in your solution? Usually when you add a web form it is created alongside the designer file as shown below:

default.jpg

Regardless of whether you have added any code to this file yet, you are stating in your designer file that it has an association to this class with the line:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

Specifically the Inherits="_Default" part. If you have no default.aspx.vb file then change this line to:

<%@ Page Language="VB" AutoEventWireup="false" %>

Although, personally, I would recommend that you do have a default.aspx.vb file and that it's class is called "_Default" as this allows you to separate your markup from your server side code.

Hi djjeavons,

Its working! I have tried to change the line based on the solution that you mention above. Now i'm able to build and debug my program without error anymore.
Thank you =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.