473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

urgent-codebehind not working



hi
i thinks its a very strange problem.I had been running my file
ServerList2.aspx and i see the output(when i do f5). i am using this
file serverList2.aspx on hte left side of a main page (using frames and
all).when i run it its running fine.but when i just now check in the
vs.net design mode inside the other aspx file(serverMain), where i
inserted it on the left then i see this error:
'dgversion_itemDataBound' is not a member of serverlist2.aspx

why is this so?it means its not going to the codebehind at all! thats
why i see no color change;can someone pls respond.what do i need to do.
here is my ServerList2.aspx
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data" %>
<%@ Page Language="vb" Debug="true" %>
<HTML>
<HEAD>
<title>Database Connection Test</title>
<script runat="server">
sub Page_Load(sender as Object, e as EventArgs)
'Create a connection string
Dim connString as string
Dim objConnection as OleDbConnection
Dim strSQL, strSQL2 as string
Dim objCommand, objCommand2 as OleDbCommand
Dim objDataReader as OleDbDataReader
'connstring = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=C:\Inetpub\wwwroot\ServersNet\Servers.mdb;"

'Open a connection
connstring=ConfigurationSettings.AppSettings("Conn ectionString")
objConnection = New OleDbConnection(connstring)
objConnection.Open()

'Specify the SQL string
'strSQL = "Select IDkey, ServerName from Backup where IDKey is not
Null"
'strSQL2 = "select Name, Dept, ApproveUser from ServerMain"
strsql="SELECT Backup.IDKey, Backup.Servername, ServerMain.ApproveUser
FROM backup INNER JOIN ServerMain ON Backup.IDKey = ServerMain.IDKey"
'Create a command object

objCommand = New OleDbCommand(strSQL, objConnection)
'objCommand2 = New OleDbCommand(strSQL2, objConnection)
'Get a datareader
objDataReader =
objCommand.ExecuteReader(CommandBehavior.CloseConn ection)

'Do the DataBinding w
dgVersion.DataSource = objDataReader
dgVersion.DataBind()

'Close the datareader/db connection
objDataReader.Close()

end sub
</script>
</HEAD>
<body>
<asp:datagrid id="dgVersion" runat="server"
AutoGenerateColumns="False" ShowFooter="True"
OnItemDataBound="dgVersion_ItemDataBound">
<Columns>
<asp:TemplateColumn HeaderText="Server List"
HeaderStyle-Font-Bold="True">
<ItemTemplate>
<asp:HyperLink id="AttachmentLink"
Target="main" runat="server" NavigateUrl='<%# "ServerMain2.aspx?ID=" &
Server.UrlEncode(Container.DataItem("IDKey")).Tost ring()%>'>

<%#DataBinder.Eval(Container.DataItem,"ServerName" )%>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid><br>
<br>
</body>
</HTML>
here is my serverList2.aspx.vb
pls suggest me as i have spent a day trying to color code m y datagrid
output and it just doenst work because it never goes in codebehind.pls
suggest me how to resolve this error
Public Class ServerList2
Inherits System.Web.UI.Page
Protected WithEvents dgVersion 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

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Sub dgVersion_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgVersion.ItemDataBound
'Dim itemType As ListItemType = e.Item.ItemType
'If (e.Item.ItemType = ListItemType.Item Or _
' e.Item.ItemType = ListItemType.AlternatingItem Or
e.Item.ItemType = ListItemType.EditItem) Then

'If e.Item.Cells(1).Text = "APPLICATION" Then
'If CType(e.Item.FindControl("AttachmentLink"), HyperLink).Text
= "APPLICATION" Then
'If e.Item.Cells(0).Text <> "" Then
'e.Item.BackColor = Color.Red
'Else
' e.Item.ForeColor = Color.Red
'End If

'End If
Dim HPL As HyperLink = e.Item.FindControl("AttachementLink")
If HPL.Text = "APPLICATION" Then
e.Item.BackColor = Color.Red
Else
e.Item.BackColor = Color.Green
End If

End Sub

Private Sub dgVersion_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgVersion.ItemCreated

End Sub
End Class

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
0 1179

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
7
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn"...
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.