Code Behind Not working
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngibuyspy' list.


Snipes, Jason
I am having trouble getting my CodeBehind page to work for a module I am
developing.

Here is the module code:

<%@ Control Inherits="ASPNetPortal.PortalModuleControl" Language="vb"
CodeBehind="ap6PhoneList.ascx.vb" AutoEventWireup="false" %>
<%@ Register TagPrefix="Portal" TagName="Title"
Src="~/DesktopModuleTitle.ascx" %>

<portal:title runat="server"></portal:title>
<br />
<asp:DataGrid id="grid1" runat="server" Width="100%" Border="0"
ShowFooter="false" CellPadding="3" CellSpacing="0" Font-Name="Verdana"
Font-Size="8pt" Headerstyle-BackColor="#336699" Headerstyle-Font-Size="10pt"
Headerstyle-ForeColor="#FFFFFF" MaintainState="false"
ItemStyle-BackColor="#FFFFFF" AlternatingItemStyle-BackColor="#CCCCCC">
<HeaderStyle font-size="10pt" forecolor="White"
backcolor="#336699"></HeaderStyle>
<AlternatingItemStyle backcolor="#CCCCCC"></AlternatingItemStyle>
<ItemStyle backcolor="White"></ItemStyle>
</asp:DataGrid>

Here is my code behind page:
Imports System.Data
Imports System.Data.SqlClient
Namespace ASPNetPortal

Public MustInherit Class ap6Phonelist
Inherits ASPNetPortal.PortalModuleControl
Protected WithEvents grid1 As System.Web.UI.WebControls.DataGrid
#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

'*******************************************************
'
' The Page_Load event handler on this User Control is used to
' obtain a DataSet of Phone Number information for AP6
'
'*******************************************************

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles
MyBase.Load
Dim connection As SqlConnection
Dim command As SqlCommand

connection = New
SqlConnection("server=echo;uid=wwwutil;pwd=gemini144;database=devwebdb")
command = New SqlCommand("fl_Phone_Query_ap6", connection)
connection.Open()

grid1.DataSource command.ExecuteReader(CommandBehavior.CloseConnection)
grid1.DataBind()

End Sub

End Class
End Namespace

The Page_Load will not run for my module. This page started out with all of
the code inline, but my company has decided to make code behind the standard
from now on.

Thanks in advance
Jason Snipes

This electronic message may contain confidential or privileged information
and is intended for the individual or entity named above. If you are
not the intended recipient, be aware that any disclosure, copying,
distribution or use of the contents of this information is prohibited.
If you have received this electronic transmission in error, please notify
the sender immediately by using the e-mail address or by telephone
(704-633-8250).
Reply to this message...
 
    
Snipes, Jason
Nevermind. You know how it goes, As soon as you post an question you
discover the answer. I needed to reference ASPNetPortal.ap6Phonelist class
and then it will work.

Sorry for the dumb question...

Jason

-----Original Message-----
From: Snipes, Jason [mailto:Click here to reveal e-mail address]
Sent: Monday, August 12, 2002 10:49 AM
To: aspngibuyspy
Subject: [aspngibuyspy] Code Behind Not working

I am having trouble getting my CodeBehind page to work for a module I am
developing.

Here is the module code:

<%@ Control Inherits="ASPNetPortal.PortalModuleControl" Language="vb"
CodeBehind="ap6PhoneList.ascx.vb" AutoEventWireup="false" %>

<%@ Register TagPrefix="Portal" TagName="Title"
Src="~/DesktopModuleTitle.ascx" %>

<portal:title runat="server"></portal:title>
<br />
<asp:DataGrid id="grid1" runat="server" Width="100%" Border="0"
ShowFooter="false" CellPadding="3" CellSpacing="0" Font-Name="Verdana"
Font-Size="8pt" Headerstyle-BackColor="#336699" Headerstyle-Font-Size="10pt"
Headerstyle-ForeColor="#FFFFFF" MaintainState="false"
ItemStyle-BackColor="#FFFFFF" AlternatingItemStyle-BackColor="#CCCCCC">

<HeaderStyle font-size="10pt" forecolor="White"
backcolor="#336699"></HeaderStyle>
<AlternatingItemStyle backcolor="#CCCCCC"></AlternatingItemStyle>
<ItemStyle backcolor="White"></ItemStyle>
</asp:DataGrid>

Here is my code behind page:
Imports System.Data
Imports System.Data.SqlClient
Namespace ASPNetPortal

Public MustInherit Class ap6Phonelist
Inherits ASPNetPortal.PortalModuleControl
Protected WithEvents grid1 As System.Web.UI.WebControls.DataGrid
#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

'*******************************************************
'
' The Page_Load event handler on this User Control is used to
' obtain a DataSet of Phone Number information for AP6
'
'*******************************************************

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles
MyBase.Load
Dim connection As SqlConnection
Dim command As SqlCommand

connection = New
SqlConnection("server=echo;uid=wwwutil;pwd=gemini144;database=devwebdb")
command = New SqlCommand("fl_Phone_Query_ap6", connection)
connection.Open()

grid1.DataSource command.ExecuteReader(CommandBehavior.CloseConnection)
grid1.DataBind()

End Sub

End Class
End Namespace

The Page_Load will not run for my module. This page started out with all of
the code inline, but my company has decided to make code behind the standard
from now on.

Thanks in advance
Jason Snipes

This electronic message may contain confidential or privileged information
and is intended for the individual or entity named above. If you are
not the intended recipient, be aware that any disclosure, copying,
distribution or use of the contents of this information is prohibited.
If you have received this electronic transmission in error, please notify
the sender immediately by using the e-mail address or by telephone
(704-633-8250).

| [aspngibuyspy] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngibuyspy.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

This electronic message may contain confidential or privileged information
and is intended for the individual or entity named above. If you are
not the intended recipient, be aware that any disclosure, copying,
distribution or use of the contents of this information is prohibited.
If you have received this electronic transmission in error, please notify
the sender immediately by using the e-mail address or by telephone
(704-633-8250).
Reply to this message...
 
 
System.Data.CommandBehavior
System.Data.DataSet
System.Data.SqlClient.SqlCommand
System.Data.SqlClient.SqlConnection
System.EventArgs
System.Object
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com