.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 5th, 2003, 03:26 PM
rbrown1962 rbrown1962 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 rbrown1962 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Odd behaviour

Here is a puzzling one,

I have an aspx page with a code behind file, for some reason all of a sudden the page skips processing some of the lines, simple if tests for examples.

I even created a web service, and enscapulated my code in there to do what I needed to do. The pages hits the line to call the web service, but does nothing. No error or anything.

Same thing with the if tests, I have a session variable which may or may not contain the value of "True" or "False" I do a simple if test, testing its value and then do some processing based on it, it simply skips over it.

Anyone seen anything close to this odd behaviour before ????

Reply With Quote
  #2  
Old August 6th, 2003, 04:48 AM
LeonJollans LeonJollans is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 27 LeonJollans User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sounds like the test is failing, simple as that. Post your code

Reply With Quote
  #3  
Old August 6th, 2003, 01:50 PM
rbrown1962 rbrown1962 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 4 rbrown1962 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code - HELP PLEASE

Ok this is really starting to freak me. I went back today to take a fresh look at this thing ,, the code on the code behind file processes and then it very conveniently simply exits out of the routine before executing the If block where it tests the Session variables. (See code below) if anyone has any idea on this one, please holler up .

CODE -------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim strHTML As String
Dim owebsr As localhost1.Service1
owebsr = New localhost1.Service1
Dim oMenus As localhost2.Service1 = New localhost2.Service1
Dim MenuForstring As String
' This code executes fine
Me.TDStats.InnerHtml = "<FONT face='Arial' size='1'>Animals in System = " & owebsr.GetAnimalCnt(Session("ConnString")) & "</FONT>"
Me.TDStats2.InnerHtml = "<FONT face='Arial' size='1'> Breeders in System = " & owebsr.GetBreederCnt(Session("ConnString")) & "</FONT>"
Me.TDStats3.InnerHtml = " <FONT face='Arial' size='1'> Owners in System = " & owebsr.GetOwnerCnt(Session("ConnString")) & "</FONT>"

If Session("Bab_Admin_b") = "True" Then
strHTML = ""
strHTML = strHTML & "<IMG onmouseover=" & Chr(34) & "this.src='Images/breedersOv.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/breedersT.gif';" & Chr(34)
strHTML = strHTML & "src='Images/breedersT.gif'><IMG onmouseover=" & Chr(34) & "this.src='Images/Ownersov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/OwnersT.gif';" _
& Chr(34) & "src='Images/OwnersT.gif'><IMG onmouseover=" & Chr(34) & "this.src='Images/Logonov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onclick=" & Chr(34) & "poopen('Login.aspx')" _
& Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/LogonT.gif';" & Chr(34) & "src='Images/LogonT.gif'> <IMG onmouseover=" & Chr(34) & "this.src='Images/UsersListO.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onclick=" & Chr(34) & "poopen('Admin_Users.aspx')" _
& Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/UsersListT.gif';" & Chr(34) & "src='Images/UsersListT.gif'> <IMG onmouseover=" & Chr(34) & "this.src='Images/searchov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/searchT.gif';" _
& Chr(34) & "src='mages/searchT.gif'> <IMG onmouseover=" & Chr(34) & "this.src='Images/ContactUsov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/ContactUsT.gif';" _
& Chr(34) & "src='Images/ContactUsT.gif'>"
Me.TDMENUBAR.InnerHtml = strHTML
Else

strHTML = ""
strHTML = strHTML & "<IMG onmouseover=" & Chr(34) & "this.src='Images/breedersOv.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/breedersT.gif';" & Chr(34)
strHTML = strHTML & "src='Images/breedersT.gif'><IMG onmouseover=" & Chr(34) & "this.src='Images/Ownersov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/OwnersT.gif';" _
& Chr(34) & "src='Images/OwnersT.gif'><IMG onmouseover=" & Chr(34) & "this.src='Images/Logonov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onclick=" & Chr(34) & "poopen('Login.aspx')" _
& Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/LogonT.gif';" & Chr(34) & "src='Images/LogonT.gif'> <IMG onmouseover=" & Chr(34) & "this.src='Images/RegisterO.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onclick=" & Chr(34) & "poopen('UsersEntry.aspx')" _
& Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/RegisterT.gif';" & Chr(34) & "src='Images/RegisterT.gif'> <IMG onmouseover=" & Chr(34) & "this.src='Images/searchov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/searchT.gif';" _
& Chr(34) & "src='Images/searchT.gif'> <IMG onmouseover=" & Chr(34) & "this.src='Images/ContactUsov.gif';" & Chr(34) & "style=" & Chr(34) & "vAlign: top" & Chr(34) & "onmouseout=" & Chr(34) & "this.src='Images/ContactUsT.gif';" _
& Chr(34) & "src='Images/ContactUsT.gif'>"
Me.TDMENUBAR.InnerHtml = strHTML
End If

' Routine bails out here , and does not process the code below

If Session("Bab_Admin_b") = "True" Then
MenuForstring = "Admin"
End If
If Session("Bab_Breeder_b") = "True" Then
MenuForstring = "Breeder"
End If
If Session("Bab_Owner_b") = "True" Then
MenuForstring = "Owner"
End If
If Session("Bab_User_b") = "True" Then
MenuForstring = "User"
End If
Dim s As String

oMenus = New localhost2.Service1
s = oMenus.GetMenuFor(MenuForstring)



End Sub

Reply With Quote
  #4  
Old August 7th, 2003, 04:51 AM
LeonJollans LeonJollans is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 27 LeonJollans User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
careful how you post code on this forum! It's a bit poor

I'm looking at this now, and the first thing I noticed - you should use a StringBuilder to concatenate large strings the way you are doing, It's much neater, and much faster. but I digress. re where the routine bails out:
Code:
 Routine bails out here , and does not process the code below

If Session("Bab_Admin_b") = "True" Then
MenuForstring = "Admin"
End If
If Session("Bab_Breeder_b") = "True" Then
MenuForstring = "Breeder"
End If
If Session("Bab_Owner_b") = "True" Then
MenuForstring = "Owner"
End If
If Session("Bab_User_b") = "True" Then
MenuForstring = "User"
End If

what are the actual values stored in session for these values? try Debug.WriteLine-ing them if you're using VS.NET, if not, Response.Write them out. Where are you setting these values? Don't forget that Session values in .NET are not Variant like in classic asp, you need to cast them to strings. Or Booleans, depending on your taste.

re the bit afterwards:
Code:
Dim s As String

oMenus = New localhost2.Service1
s = oMenus.GetMenuFor(MenuForstring)

End Sub


well that clearly won't appear to do anything unless you make use of the s variable later.

hth
Leon

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Odd behaviour


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT