Client Application Services access forbidden

Discussion in 'ASP.NET / ASP.NET Core' started by jimspicer, Sep 29, 2009.

  1. Hi,
    We have implemented an ASP.NET 3.5 application using your SQL Server 2005 database. The web application is working perfectly. We also need to access the database from a client application and have prototyped a Client Application Service using VS 2008. But when we attempt to authenticate the user using static Membership.ValidateUser, we get a Forbidden error from the web site. Is this not supported on your site?

    Thanks for any help,

    Jim Spicer
    perpetualbudget.com
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    i am not sure I understand what you are trying to do.. can you elaborate further?
     
  3. Hi Bruce,
    VS 2008 allows you to compile a windows application that can use asp.net login authentication, roles and profiles services. I have a simple prototype, a Windows form with this load code:

    Imports System.Net
    Imports System.Threading
    Imports System.Web.ClientServices
    Imports System.Web.ClientServices.Providers
    Imports System.Web.Security

    Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If Not Membership.ValidateUser(username, password) Then
    MessageBox.Show("Unable to authenticate.", "Not logged in", MessageBoxButtons.OK, MessageBoxIcon.Error)
    Application.Exit()
    End If
    End Sub

    End Class

    When the code hits the Membership.Validate line I get a web exception error, "Forbidden". This code is well documented but doesn't run here.

    Have I explained it sufficiently?

    Thanks,
    Jim
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    sorry.. i am not familiar with using aspnet db with console or winform app.
     

Share This Page