G
Guest
I have a simple aspx page called type with a datagrid/w id=dGrdTyp
My code behind page is not reconizing the control on the aspx page.
Visualstudio.Net flaggs the dgrdTyp as undefined. Any Help? I'm a little new
to aspx in Visual Studio.Net
code follows:
THANKS!!!!
kes
Type.aspx.....
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="type.aspx.vb"
Inherits="damarstone.type"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>type</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<asp:Label id="lblUser" runat="server" Width="176px" Height="16px"
Font-Size="Smaller">Action</asp:Label><br>
<asp:Label id="lblStatus" runat="server" Width="202px" Height="8px"
Font-Size="Smaller">User Not Logged In</asp:Label><br>
<form id="Form1" method="post" runat="server">
<asp:LinkButton id="lnkToHome" style=""
runat="server">Home</asp:LinkButton>
<asp
ataGrid
ID="dGrdTyp"
AutoGenerateColumns="false"
ShowFooter="True"
Runat="server"
EnableViewState="false">
<columns>
<asp:HyperLinkColumn DataNavigateUrlField="typID"
DataNavigateUrlFormatString="Slabs.aspx?TypID={0}" DataTextField="TypName"
Headertext="Select Stone" runat="server" ID="Hyperlinkcolumn1"
NAME="Hyperlinkcolumn1"/>
</columns>
</asp
ataGrid>
</form>
</body>
</HTML>
type.aspx.vb.....
Imports System.Data.OleDb
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Public Class type
Inherits Page
Public thsSitePath As String
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents lblUser As System.Web.UI.WebControls.Label
Protected WithEvents lblStatus As System.Web.UI.WebControls.Label
Protected WithEvents lnkToHome As System.Web.UI.WebControls.LinkButton
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
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
Call Get_Location()
lblStatus.Text = thsSitePath & "kurt"
End Sub
Private Sub Get_Location()
Dim thsUri As Uri
Dim thsHost As String
thsUri = Request.Url
thsHost = thsUri.Host
If (thsHost = "www.damarstone.com") Then
thsSitePath = "c:\websites\damar\"
Else
thsSitePath = "e:\websites\damarstone\"
End If
End Sub
Private Sub BindDataGrid()
Dim conTyp As OleDbConnection
Dim cmdSelectTyp As OleDbCommand
Dim dtrTyp As OleDbDataReader
lnkToHome.Text = "me"
conTyp = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=" & thsSitePath & "db\damarstone.mdb")
cmdSelectTyp = New OleDbCommand("SELECT t.typID, t.typName,
t.typeDesc FROM typ t ORDER BY t.typName;", conTyp)
conTyp.Open()
dtrTyp = cmdSelectTyp.ExecuteReader()
dGrdTyp.DataSource = dtrTyp
dGrdTyp.DataBind()
dtrTyp.Close()
conTyp.Close()
End Sub
End Class
My code behind page is not reconizing the control on the aspx page.
Visualstudio.Net flaggs the dgrdTyp as undefined. Any Help? I'm a little new
to aspx in Visual Studio.Net
code follows:
THANKS!!!!
kes
Type.aspx.....
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="type.aspx.vb"
Inherits="damarstone.type"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>type</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<asp:Label id="lblUser" runat="server" Width="176px" Height="16px"
Font-Size="Smaller">Action</asp:Label><br>
<asp:Label id="lblStatus" runat="server" Width="202px" Height="8px"
Font-Size="Smaller">User Not Logged In</asp:Label><br>
<form id="Form1" method="post" runat="server">
<asp:LinkButton id="lnkToHome" style=""
runat="server">Home</asp:LinkButton>
<asp
ID="dGrdTyp"
AutoGenerateColumns="false"
ShowFooter="True"
Runat="server"
EnableViewState="false">
<columns>
<asp:HyperLinkColumn DataNavigateUrlField="typID"
DataNavigateUrlFormatString="Slabs.aspx?TypID={0}" DataTextField="TypName"
Headertext="Select Stone" runat="server" ID="Hyperlinkcolumn1"
NAME="Hyperlinkcolumn1"/>
</columns>
</asp
</form>
</body>
</HTML>
type.aspx.vb.....
Imports System.Data.OleDb
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Public Class type
Inherits Page
Public thsSitePath As String
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents lblUser As System.Web.UI.WebControls.Label
Protected WithEvents lblStatus As System.Web.UI.WebControls.Label
Protected WithEvents lnkToHome As System.Web.UI.WebControls.LinkButton
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
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
Call Get_Location()
lblStatus.Text = thsSitePath & "kurt"
End Sub
Private Sub Get_Location()
Dim thsUri As Uri
Dim thsHost As String
thsUri = Request.Url
thsHost = thsUri.Host
If (thsHost = "www.damarstone.com") Then
thsSitePath = "c:\websites\damar\"
Else
thsSitePath = "e:\websites\damarstone\"
End If
End Sub
Private Sub BindDataGrid()
Dim conTyp As OleDbConnection
Dim cmdSelectTyp As OleDbCommand
Dim dtrTyp As OleDbDataReader
lnkToHome.Text = "me"
conTyp = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=" & thsSitePath & "db\damarstone.mdb")
cmdSelectTyp = New OleDbCommand("SELECT t.typID, t.typName,
t.typeDesc FROM typ t ORDER BY t.typName;", conTyp)
conTyp.Open()
dtrTyp = cmdSelectTyp.ExecuteReader()
dGrdTyp.DataSource = dtrTyp
dGrdTyp.DataBind()
dtrTyp.Close()
conTyp.Close()
End Sub
End Class