CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: NewsGroup Date Entered: 11/5/2007 6:38:22 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
pakman83
Asp.Net User
Code Behind problem11/5/2007 6:38:22 PM

0/0

Hello,

I am having an interesting problem. This is not my first time developing in ASP.NET but this problem is a first. I hope someone can help me.

 I've created a new ASP.NET Web Application and began coding up a single aspx page. Once I was done and I compiled, I ran the code and the page wouldn't display in IE. However, If I viewed the source, I can see all the generated HTML. If I run the same code under mozilla, it runs just fine. I added some html in the default.aspx page to see if it would display and it does just fine in IE and Mozilla. If I look under the bin directory of my application, I only see two dlls from a referenced project, but I see nothing else. What could the problem be? Is the vb code for my aspx page not compiling?

 Your help is highly appreciated. Thanks in advance.

-- K

dharmon23
Asp.Net User
Re: Code Behind problem11/5/2007 7:25:36 PM

0/0

could you post the code for the page?

pakman83
Asp.Net User
Re: Code Behind problem11/5/2007 7:32:27 PM

0/0

HELLO WORLD HELLO WORLD INSIDE A SPAN NOT SPAM
Sure thing, here is the aspx.

 

and here it eh vb code behind

Imports OrgChartObjects

Partial Class OrgChart_OrgChart

Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then

' init objects

Dim uscpNode As OrgTreeNode = initTree()

' traverse the tree and draw on the page

'Dim rowChildArray As ArrayList = Nothing

Dim rowNodeArray As New ArrayList

rowNodeArray.Add(uscpNode)

Dim flag As Boolean = True

' while we still have nodes

While flag

' create a row

Dim tableRow As New TableRow()

' as we go, we will collect all the children of the next row

Dim nextRowChildren As ArrayList = Nothing

' for each node in this row

For i As Integer = 0 To rowNodeArray.Count - 1

' get the node

Dim node As OrgTreeNode = CType(rowNodeArray.Item(i), OrgTreeNode)

' check for its children

If node.Children IsNot Nothing Then

' if this node has children, collect them and save them

For Each child As Object In node.Children

If nextRowChildren Is Nothing Then

nextRowChildren = New ArrayList()

End If

nextRowChildren.Add(CType(child, OrgTreeNode))

Next

End If

' depending on the number of children in the next row,

' attempt to center this row

' for this row create a control and add it

Dim tableCell As New TableCell()

Dim nodeTable As Table = createOrgNodeControl(node)

tableCell.Controls.Add(nodeTable)

tableRow.Controls.Add(tableCell)

Next

Me.TableOrgChart.Controls.Add(tableRow)

If nextRowChildren IsNot Nothing Then

' if we have more children to add to the list, get them

' for next iteration

rowNodeArray.Clear()

rowNodeArray = nextRowChildren

Else

' clean up

rowNodeArray.Clear()

flag = False

End If

End While

End If

End Sub

Private Function createOrgNodeControl(ByVal treeNode As OrgTreeNode) As Table

Dim myTable As New Table

myTable.ID = treeNode.Name

myTable.SkinID = "OrgChartNode"

Dim tableRow0 As New TableRow

Dim tableCell00 As New TableCell

Dim labelOrgName As New Label

labelOrgName.SkinID = "OrgNameLabel"

labelOrgName.Text = treeNode.Name

tableCell00.Controls.Add(labelOrgName)

tableRow0.Controls.Add(tableCell00)

myTable.Controls.Add(tableRow0)

If treeNode.MyPersonnel IsNot Nothing Then

For Each personnel As Personnel In treeNode.MyPersonnel

Dim tableRow As New TableRow

Dim tableCell As New TableCell

Dim personnelLabel As New Label

personnelLabel.SkinID = "PersonnelLabel"

personnelLabel.Text = personnel.Title & " " & personnel.Name

tableCell.Controls.Add(personnelLabel)

tableRow.Controls.Add(tableCell)

myTable.Controls.Add(tableRow)

Next

End If

If treeNode.Children IsNot Nothing Then

Dim tableRow1 As New TableRow

Dim tableCell01 As New TableCell

Dim tableCell02 As New TableCell

Dim expandLink As New HyperLink

Dim collapseLink As New HyperLink

expandLink.Text = "expand"

collapseLink.Text = "collapse"

Dim arguments As String = String.Empty

If treeNode.Children IsNot Nothing Then

For i As Integer = 0 To treeNode.Children.Count - 1

arguments += "'" & CType(treeNode.Children.Item(i), OrgTreeNode).Name & "'"

If i < treeNode.Children.Count - 1 Then

arguments += ", "

End If

Next

End If

expandLink.NavigateUrl = "javascript:expand(" & arguments & ");"

collapseLink.NavigateUrl = "javascript:collapse(" & arguments & ");"

tableCell01.Controls.Add(expandLink)

tableCell02.Controls.Add(collapseLink)

tableRow1.Controls.Add(tableCell01)

tableRow1.Controls.Add(tableCell02)

myTable.Controls.Add(tableRow1)

End If

If treeNode.ParentId <> -1 Then

myTable.Style.Add("visibility", "hidden")

'Else

' myTable.Style.Add("visibility", "visible")

End If

Return myTable

End Function

Private Function initTree() As OrgTreeNode

Dim uscpNode As New OrgTreeNode()

' some object init code here

Return uscpNode

End Function

End Class

pakman83
Asp.Net User
Re: Code Behind problem (formatted w/code tags)11/5/2007 7:33:34 PM

0/0

1    Imports OrgChartObjects
2    
3    Partial Class OrgChart_OrgChart
4    
5    Inherits System.Web.UI.Page
6    
7    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
8    
9    If Not IsPostBack Then
10   
11   ' init objects
12   
13   Dim uscpNode As OrgTreeNode = initTree()
14   
15   ' traverse the tree and draw on the page
16   
17   'Dim rowChildArray As ArrayList = Nothing
18   
19   Dim rowNodeArray As New ArrayList
20   
21   rowNodeArray.Add(uscpNode)
22   
23   Dim flag As Boolean = True
24   
25   ' while we still have nodes
26   
27   While flag
28   
29   ' create a row
30   
31   Dim tableRow As New TableRow()
32   
33   ' as we go, we will collect all the children of the next row
34   
35   Dim nextRowChildren As ArrayList = Nothing
36   
37   ' for each node in this row
38   
39   For i As Integer = 0 To rowNodeArray.Count - 1
40   
41   ' get the node
42   
43   Dim node As OrgTreeNode = CType(rowNodeArray.Item(i), OrgTreeNode)
44   
45   ' check for its children
46   
47   If node.Children IsNot Nothing Then
48   
49   ' if this node has children, collect them and save them
50   
51   For Each child As Object In node.Children
52   
53   If nextRowChildren Is Nothing Then
54   
55   nextRowChildren = New ArrayList()
56   
57   End If
58   
59   nextRowChildren.Add(CType(child, OrgTreeNode))
60   
61   Next
62   
63   End If
64   
65   ' depending on the number of children in the next row,
66   
67   ' attempt to center this row
68   
69   ' for this row create a control and add it 
70   
71   Dim tableCell As New TableCell()
72   
73   Dim nodeTable As Table = createOrgNodeControl(node)
74   
75   tableCell.Controls.Add(nodeTable)
76   
77   tableRow.Controls.Add(tableCell)
78   
79   Next
80   
81   Me.TableOrgChart.Controls.Add(tableRow)
82   
83   If nextRowChildren IsNot Nothing Then
84   
85   ' if we have more children to add to the list, get them
86   
87   ' for next iteration
88   
89   rowNodeArray.Clear()
90   
91   rowNodeArray = nextRowChildren
92   
93   Else
94   
95   ' clean up
96   
97   rowNodeArray.Clear()
98   
99   flag = False
100  
101  End If
102  
103  End While
104  
105  End If
106  
107  End Sub
108  
109  Private Function createOrgNodeControl(ByVal treeNode As OrgTreeNode) As Table
110  
111  Dim myTable As New Table
112  
113  myTable.ID = treeNode.Name
114  
115  myTable.SkinID = "OrgChartNode"
116  
117  Dim tableRow0 As New TableRow
118  
119  Dim tableCell00 As New TableCell
120  
121  Dim labelOrgName As New Label
122  
123  labelOrgName.SkinID = "OrgNameLabel"
124  
125  labelOrgName.Text = treeNode.Name
126  
127  tableCell00.Controls.Add(labelOrgName)
128  
129  tableRow0.Controls.Add(tableCell00)
130  
131  myTable.Controls.Add(tableRow0)
132  
133  If treeNode.MyPersonnel IsNot Nothing Then
134  
135  For Each personnel As Personnel In treeNode.MyPersonnel
136  
137  Dim tableRow As New TableRow
138  
139  Dim tableCell As New TableCell
140  
141  Dim personnelLabel As New Label
142  
143  personnelLabel.SkinID = "PersonnelLabel"
144  
145  personnelLabel.Text = personnel.Title & " " & personnel.Name
146  
147  tableCell.Controls.Add(personnelLabel)
148  
149  tableRow.Controls.Add(tableCell)
150  
151  myTable.Controls.Add(tableRow)
152  
153  Next
154  
155  End If
156  
157  If treeNode.Children IsNot Nothing Then
158  
159  Dim tableRow1 As New TableRow
160  
161  Dim tableCell01 As New TableCell
162  
163  Dim tableCell02 As New TableCell
164  
165  Dim expandLink As New HyperLink
166  
167  Dim collapseLink As New HyperLink
168  
169  expandLink.Text = "expand"
170  
171  collapseLink.Text = "collapse"
172  
173  Dim arguments As String = String.Empty
174  
175  If treeNode.Children IsNot Nothing Then
176  
177  For i As Integer = 0 To treeNode.Children.Count - 1
178  
179  arguments += "'" & CType(treeNode.Children.Item(i), OrgTreeNode).Name & "'"
180  
181  If i < treeNode.Children.Count - 1 Then
182  
183  arguments += ", "
184  
185  End If
186  
187  Next
188  
189  End If
190  
191  expandLink.NavigateUrl = "javascript:expand(" & arguments & ");"
192  
193  collapseLink.NavigateUrl = "javascript:collapse(" & arguments & ");"
194  
195  tableCell01.Controls.Add(expandLink)
196  
197  tableCell02.Controls.Add(collapseLink)
198  
199  tableRow1.Controls.Add(tableCell01)
200  
201  tableRow1.Controls.Add(tableCell02)
202  
203  myTable.Controls.Add(tableRow1)
204  
205  End If
206  
207  If treeNode.ParentId <> -1 Then
208  
209  myTable.Style.Add("visibility", "hidden")
210  
211  'Else
212  
213  ' myTable.Style.Add("visibility", "visible")
214  
215  End If
216  
217  Return myTable
218  
219  End Function
220  
221  Private Function initTree() As OrgTreeNode
222  
223  Dim uscpNode As New OrgTreeNode()
224  
225  ' some object init code here
226  
227  Return uscpNode
228  
229  End Function
230  
231  End Class
232  

 

Here is the aspx 

  

1    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="OrgChart.aspx.vb" Inherits="OrgChart_OrgChart" Theme="USCPTheme" %>
2    
3    <html xmlns="http://www.w3.org/1999/xhtml" >
4    
5    <head runat="server">
6    
7    <title>USCP Org Chart</title>
8    
9    <script language="javascript" type="text/javascript" src="../js/OrgChartScript.js" />
10   
11   </head>
12   
13   <body>
14   
15   <form id="formOrgChart" runat="server">
16   
17   <div>
18   
19   HELLO WORLD
20   
21   <span>HELLO WORLD INSIDE A SPAN NOT SPAM</span>
22   
23   <asp:Table ID="TableOrgChart" runat="server">
24   
25   </asp:Table>
26   
27   </div>
28   
29   </form>
30   
31   </body>
32   
33   </html>
34   
 

 

pakman83
Asp.Net User
Re: Code Behind problem (formatted w/code tags)11/6/2007 5:54:21 PM

0/0

Nevermind. I solved it. i had the script tag as

<script language="javascript" src="../js/OrgChartScript.js" type="text/javascript" /> and not

<script language="javascript" src="../js/OrgChartScript.js" type="text/javascript"></script> it wouldn't display the code.

 Marvelous...

 

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming Sudoku Authors: Wei Meng Lee, Pages: 214, Published: 2006
Pro ASP.NET 2.0 in VB 2005: special edition. Authors: Laurence Moroney, Matthew MacDonald, Pages: 1360, Published: 2006
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. LeBlond, Pages: 989, Published: 2005
Mastering ASP.NET with C# Authors: A. Russell Jones, Pages: 816, Published: 2002
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Mac OS X: The Missing Manual, Panther Edition: The Missing Manual Authors: David Pogue, Pages: 776, Published: 2003
Establishment of New Share Reservation Rights and Stock Options in Japan Focus on Problems of the Legislative Process Behind the Revision of the Commercial Code and Study on US-Japan Stock-option-related Issues: Focus on Problems of the Legislative Process Behind the Revision of the Commercial Code and Study on US-Japan Stock-option-related Issues Authors: Takeshi Motomura, Pages: 124, Published: 2003

Web:
ASP.NET - Wikipedia, the free encyclopedia Note that this sample uses code "inline", as opposed to code behind. ..... Microsoft has solved this problem by releasing the ASP. ...
ASP 101 - Using ASP.NET Code-Behind Without Visual Studio.NET The problem is simply that it can't find the class we define in our code-behind file. Normally VS.NET will automatically compile the .vb file into a .dll ...
Code behind problem.. - ProgrammingTalk Code behind problem.. ASP.NET. ... (problem using php variables in html db insert code), chronic_, PHP, 2, 06-13-04 11:19 AM ...
AccordionPane Code Behind Problem - ASP.NET Forums AccordionPane Code Behind Problem. Last post 10-06-2008 10:31 AM by rmsa. 2 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Codebehind problem - .NET ASP Codebehind problem. Get answers to your questions in our .NET ASP forum.
INFO: ASP.NET Code-Behind Model Overview This article provides a brief overview of the code-behind model, which is introduced in ASP.NET.
Microsoft: ASP.NET - Javascript in code-behind problem Thats great but have you any idea how I can use this in the code behind. My problem is that Im using a server.transfer to redirect the page and take accross ...
C# .NET Download file on button click code behind problem Download file on button click code behind problem. Bill Lange posted at 19-Dec- 03 11:18. I can successfully download a text file using Response. ...
MVC Server Control Code Behind Problem « Developer Flotsam Jan 3, 2008 ... 2 Responses to “MVC Server Control Code Behind Problem”. David Kirkland Says: January 31, 2008 at 2:08 am. Thanks for this tip! ...
p2p.wrox.com Forums - Base Class for Code-Behind Problem In thePhile It was normal and PhilePage_Load load first and then Page_Load (of the code-behind) so what’s the problem in my code? ...

Videos:
Addictive feat. T2 Gonna Be Mine Behind the Scenes This is footage from behind the scenes at the 'Gonna Be Mine' video shoot. 'Gonna Be Mine' is available NOW on download at http://phobos.apple.com...
The Secret behind the Hebrew alphabet Detailed description behind all the Hebrew Bible letters. Code of the Hebrew letters. Kabbalah , English Subtitles , Bible codes , mysticism Hidabroo...
Science Behind siRNA Introduction to the biology of siRNA in regards to a new cancer treatment.
Hacked Trane XL19i - Behind a jail cell! This Trane XL19i is installed behind a pool fence but the worst of it is that the electrical and refer access is impossible to access because it's be...
My code works below the surface A Developer from Infusion explains how the code works behind applications that run on Microsoft Surface.
Quixtar Home Based Business - BE *SCARED*... http://www.showmefreedom.info Eric Binnion (940) 228-4613 quixtar home based business quixtar home based business Quixtar Quixtar Home Based Bus...
Hidden Eye Codes for Improving Vision Behind your eye prescription, symptoms and problems lies a secret code, I call the KaplanEyecode. In a scientific way the eye information can be deco...
Monty Hall Paradox http://www.letsmakeadeal.com/ The problem originated in a game-show, where the winner was given 3 doors to choose from, one of which has a luxury ca...
Website Spoofing - What is it and how to avoid it Spoofing is a website that looks like a legitimate known site that is actually a different site with code behind it that will steal your information
Who Was Jesus? Fingerprints of The Christ (Part 1 of 2) Review of 'Who Was Jesus? Fingerprints of the Christ' by Dr. Robert H. Eisenman (Professor of Middle East Religions and Archaeology and Islamic Law a...




Search This Site:










sitemap path does not work

trustlevel issue

datetime question

what's the source of the profilecommon class?

navigation question/configuration

password expiry check??

question on control creation

get "execute permission denied on object 'sp_sdidebug', database 'master', owner 'dbo'." error when debugger attached

error nsurvey 1.8 for dnn 3

tab strip control

crystal report in dotnetnuke

creditcard encryption

vs standard edition - protection of source code

how to refresh design view in custom controls

ide is not identifying errors while building the site if pages are not opened

webpart help

dynamically create tabstrip(code behind)

help with error in dnn 3

need a strong dnn implementor

physical file path question

how to check if current user is of windows administrator status?

encrypt connectionstring in webconfig?

question about redirecting

compiling a website in vs 2005

setting focus on one control button issue

minimize or close

reusing code

anyone know how to place multiple forms in a master page

sitemappath

i deleted the asp . net account on xp

 
All Times Are GMT