very wierd problem...

Discussion in 'ASP.NET 2.0' started by CFreeskier, Sep 16, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. So I am designing a forum that uses the standard ASP.NET 2.0 authentication model and membership services, and when I run my page on my local server, it works fine, but as soon as I try to run it on the DiscountASP server, it throws an 'Object reference not set to an instance of an object' error. I have no idea why this would be. All I'm trying to do is display the number of useres currently online using the Membership.GetNumberOfUsersOnLine function. My code-behind page is as follows. Any help would be greatly appreciated.





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


    Dim UsersTxt As Label = LoginView1.FindControl("Users")


    UsersTxt.Text = Membership.GetNumberOfUsersOnline().ToString()


    End Sub
     
  2. This is a very generic error .It is usually caused when using a reference variable whole value is set to null or nothing .In your case,it could be the function 'GetNumberOfUsersOnline' method .Is you membership schema setup properly on the DASP SQL Server?

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Vikrams' right. I've gotten that message dozens of times and each time it was a different problem generating it. I had the same problem as you, and in my case it was my connection string in the web.config file. I had the wrong connection string.


    Good luck,


    Lar
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page