Code Behind

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lenniekuah
    New Member
    • Oct 2006
    • 126

    Code Behind

    Hi Good Guys,
    Please help me. I need your help.

    In my office I am the only Web Developer. There are no other Web Developer.

    I was confused by my co-worker programmers regarding the meaning of Code Behind. They told me there is no such Code Behind.

    Please highlight which is CodeBehind from these 2 sets of sample coding:

    these are from HTML
    Code:
    <!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>Untitled Page</title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
        <link href="MainStyleSheet.css" rel="stylesheet" type="text/css" />
    </head>
    -------------------------
    There are from ASP.NET Form
    Code:
    Option Explicit On
    Imports System.Web
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    
    Partial Public Class MasterPage
        Inherits System.Web.UI.MasterPage
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            If Request.IsAuthenticated = False Then
                lblWelcome.visible = False
            Else
                lblWelcome.visible = True
            End If
        End Sub
    
    End Class

    Of the 2 sets of sample cpding which one is called CodeBehind ?
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Hi Lennie,

    the second one is called the Code Behind. It is usually saved in a separate file with a .vb extension. So if the first codepart is called Default.aspx then the second part is called Default.aspx.vb .

    In Visual Studio, you can separate these pages in the Solution Explorer (see attachment). Check the second icon (called Show All Files).

    Steven
    Attached Files

    Comment

    • lenniekuah
      New Member
      • Oct 2006
      • 126

      #3
      Hi MrMancunian,
      Thank you very much for the information. You are very awesome and generous in sharing information. Appreciate your help very much.

      Comment

      Working...