Using SRC attribute with Visual Studio.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    #1

    Using SRC attribute with Visual Studio.NET

    Hi,

    I understand that the CodeBehind= is designed to be used
    by VS and not actually part of the .NET framework

    However, in my BenefitsVB project to test how the SRC
    works, I created a simple aspx and codebind (below) and
    added Src="WebFormSrc .aspx.vb" to the page directive.

    I then tried to browse the page and got:

    Parser Error Message: The base
    type 'BenefitsVB.Web FormSrc' does not exist in the source
    file 'WebFormSrc.asp x.vb'.

    To get this to work, I had to change my inherits to
    Inherits="WebFo rmSrc" and it ran OK. However when I
    edited the code behind VS.NET put the project name back
    into the Inherits attribute.

    1.) Is the SRC designed to NOT be used with Visual Studio?
    2.) When the SRC compiles the codebehind where does it put
    the compiled version.
    3.) If I want to tweak one codebehind file in VS.NET
    project instead of recopiling the whole project to a
    new .DLL is this possible using the SRC?

    <%@ Page Language="vb" AutoEventWireup ="false"
    Codebehind="Web FormSrc.aspx.vb "
    Inherits="Benef itsVB.WebFormSr c" Src="WebFormSrc .aspx.vb"%>
    <html>
    <body MS_POSITIONING= "GridLayout ">
    <form id="Form1" method="post"
    runat="server">
    </form>
    </body>
    </html>


    Public Class WebFormSrc
    Inherits System.Web.UI.P age

    Private Sub Page_Load(ByVal sender As System.Object,
    ByVal e As System.EventArg s) Handles MyBase.Load
    Response.Write( System.DateTime .Now)
    End Sub

    End Class



Working...