Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 4th, 2004, 10:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Not calling Page Load

Hello,

I have a test form with the following code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim o As String
        TextBox1.Text = "HERE"
        Label1.Text = "Variables: "

        For Each o In Request.ServerVariables
            Label1.Text &= o & "=" & Request.ServerVariables.Get(o) & "<br>"
        Next
    End Sub

and it ignores it! I can't get it to utilize the page_load event! It just has the defaults. Now I have other events in it that it is triggering just fine. Anybody have any problems with this before? Could accessing the Request.ServerVariables problem (can't get it to return any servervariables) have anything to do with the MYDOOM virus (this code is on our development machine)?

Thanks,

Brian
__________________
Brian
 
Old February 4th, 2004, 10:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

MyDoom shouldn't have anything to do with it. You can read about it here:
http://securityresponse.symantec.com...ter/venc/data/ [email protected]

And run the fix found here:
http://securityresponse.symantec.com...ter/venc/data/ [email protected]


The '@' symbol is messing up the link. You will need to add the w32.novarg... to the end of the link.
 
Old February 4th, 2004, 10:15 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Is the whole handler getting ignored or just the server variables part?
 
Old February 4th, 2004, 10:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The whole handler. Looking at the above script, the textbox is blank and the label is blank.

Thanks for your help.
 
Old February 4th, 2004, 10:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

On those links, I'm getting a file not found...
 
Old February 4th, 2004, 10:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

http://search.yahoo.com/search?p=myd...t&cop=mss&tab=

Look for the symantec link.
 
Old February 6th, 2004, 07:19 PM
Registered User
 
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So if you set a breakpoint in the handler, it never hits it?

You should see a line like

  this.Load += new System.EventHandler(this.Page_Load);

(or the vb equivalent) in the InitializeComponent() method that the
designer created for you. Can't imagine how that could fail to be there,
unless it got deleted by accident.
 
Old February 9th, 2004, 03:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You only have to declare an event handler in C#; VB.NET uses the "handles" keyword at the end of the method to link the function to the event handler (does C# have the "handles" keyword? I do not know so please pardon my lack of knowledge). Could it be that anonymous access was turned on, and that's why it wasn't accessing the server variables?

Thanks,

Brian
 
Old February 10th, 2004, 12:28 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

In VB.net you can use the Handles keyword or you can assign the handler programmatically. In C# you must assign it.

I'm not sure what you mean by your last question because anonymous access has nothing to do with accessibility to server variables.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old February 10th, 2004, 03:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I thought so too, but I'm running out of logic... Anyways I scrapped this test page. I don't know why it wasn't working, but I got it to work in the rest of my application, so I gave up. What I needed to access was "Request.ServerVariables.Get("LOGON_USER")". Whenever IIS had Anonymous Access on, this was blank. Now that it is removed, I can access the User ID to implement my application security scheme.

Thanks for all of the help everybody,

Brian

PS. I completely forgot about the "AddHandler" method; I am so used to VS.NET putting in the Handles statement for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can load JSP page? ms_shilpa BOOK: Professional Jakarta Struts 1 July 20th, 2006 10:55 AM
Page won't load data in IE rinventive PHP How-To 8 June 23rd, 2006 10:03 PM
page load() task vijayapteET Classic ASP Basics 1 October 3rd, 2005 10:19 PM
Calling second page from 1st page shoakat Classic ASP Databases 4 September 30th, 2004 04:41 AM
Load one page according to the link morpheus Classic ASP Basics 5 November 19th, 2003 03:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.