.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

Error when authenticating a user

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net
 

I have recently added this page to my website:

public class MasterMxPage : System.Web.UI.MasterPage
{
    private BLL.User _user;

    public BLL.User MxUser
    {
        get
        {
            if (Session["MxUser"] != null)
            {
                _user = (BLL.User)Session["MxUser"];
            }
            else if (Membership.GetUser() != null)
            {
                MembershipUser mUser = Membership.GetUser();
                _user = new BLL.User((Guid)mUser.ProviderUserKey);
                if (_user.Id != null)
        &n


View Complete Post


More Related Resource Links

create user wizard login error message dont show in a message box?

  

hi

 

i am using create user wizard and capturing other information within content template when a new user

registers. Some of the textboxes are binded to required field validators.

 

there is a validation control on the page and ShowMessage box is True.

If they dont complete some of the text boxes then the message box pops Up with the error message.

It does not however include information errors like "User already exists" or Email address already exists

from the create user wizard membership  UserName and Password Textboxes

 

is it possilbe to hook all of these up so I get one message box with all errors including membership ones?

 

thanks

 


"Type ASP.x is not defined" error for dynamic user control when publishing updateable

  

I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave

SimpleCtrl.aspx------------------------------

<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

<div>
    Simple control
</div>

SimpleCtrl.aspx.vb------------------------------

Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class

ContainerCtrl.aspx------------------------------

<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Error on Display user's fullname using Active Directory in asp.net using vb.net

  

Dim

wi As System.Security.Principal.WindowsIdentity =  _System.Security.Principal.WindowsIdentity.GetCurrent()

 

 

Dim a As String() = HttpContext.Current.User.

Visual Web Dev 2010 error or new user error?

  

In a new web app, using the fresh new build, I added some fields that I wanted processed during login, i.e. common Profile stuff... added them to web.config.... sadly it appears that Studio 2010 will not automatically create a ProfileCommon class from ProfileBase, as previous studio web IDE's would do - that was frustrating for a bit, then I just created my own class... but that led to this interesting problem.

When populating the new profile attributes, the code behind class could not resolve any of the textbox referenced, all showed as not defined... figuring it was something simple, I kept going... added a customValidation control I needed, but though I double clicked the event in studio, and it dutifully created the stub code for me... the event never fired.

Determined to locate the problem I poored through forum entries and every reference I could (found lots of folks complaining about the profileCommon class stuff which is what led me to create my own class finally) -- but nothing specific to the problem I had of not seeing defined controls that were clearly there and working nor my customValidator control.

But... all of the code samples I saw - none had the ContentTemplate section... curious I removed that section, other items started to fail that were logical (header tags, etc.) but, my code behind section snapped back into order, intelisense n

Error "user does not have permission to perform this operation" with User Instance = True.

  

I setup SQL Server 2005 / SQL Express. All works fine in SQL Server 2005.

I am connecting to a SQL Database from VS 2005,  Tools/Connect to Database. I set the Data Source to "Microsoft SQL Server Database File (SqlClient)" (meaning SQL Server Express) and User Instance = True, and Integrated Security = True.

The above is working successfully on all machines except my Laptop. On my Laptop, I am getting this error "user does not have permission to perform this operation". On my Laptop, if I change User Instance = False, it works fine. Also, If I connect to SQL Server 2005 it works fine only if User Instance = False.

I tried all kind of security changes, nothing worked. For example, I setup Everyone as Full Control for the Folder and the MDF File of SQL Server. I gave my user ID as sysadmin role in SQL Server Express. Also, I enabled creating User Instance form SQL Server Express, Nothing is working.

Appreciate your help.

Tarek.


Create User Wizard and Loginview error

  

 When i place the create user wizard control inside the Loginview Anonymous Template, the Create User Wizard gives an error inside the C# file. Here is a snippet

Home.aspx Web Form

 <asp:LoginView ID="LoginView2" runat="server">
     <AnonymousTemplate>
        <asp:CreateUserWizard ID="CreateUserWizard1" CreateUserButtonType="Image" 
        CreateUserButtonImageUrl="~/images/signup.png" cssclass="createuser" 
        runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser" 
        OnCreatingUser="CreateUserWizard1_CreatingUser">
           <TextBoxStyle CssClass="Ctextbox" />
            <LabelStyle cssclass="lbl" />
            <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" />
                <asp:CompleteWizardStep   ID="CompleteWizardStep1" runat="server" />
            </WizardSteps>
        </asp:CreateUserWizard>
        </AnonymousTemplate>
        <LoggedInTemplate>
        
        news here
        
        </LoggedInTemplate>
        
        
        </asp:LoginView>


Here is the C# Code with the error 

<

Error: 18456, Severity: 14, State: 16 Login failed for user 'NT AUTHORITY\SYSTEM'

  
Hi,   can someone help me with this error. Error: 18456, Severity: 14, State: 16 Login failed for user 'NT AUTHORITY\SYSTEM' [CLIENT:<local machine>] I've found several Threads but not with the NT AUTHORITY\SYSTEM.   Thanks for help.   Jens

Error "user does not have permission to perform this operation" with User Instance = True.

  
I setup SQL Server 2005 / SQL Express. All works fine in SQL Server 2005. I am connecting to a SQL Database from VS 2005,  Tools/Connect to Database. I set the Data Source to "Microsoft SQL Server Database File (SqlClient)" (meaning SQL Server Express) and User Instance = True, and Integrated Security = True. I am using Windows Authentication mode in SQL Server Express. The above is working successfully on all machines except my Laptop. On my Laptop, I am getting this error "user does not have permission to perform this operation". On my Laptop, if I change User Instance = False, it works fine. Also, If I connect to SQL Server 2005 it works fine only if User Instance = False. I tried all kind of security changes, nothing worked. For example, I setup Everyone as Full Control for the Folder and the MDF File of SQL Server. I gave my user ID as sysadmin role in SQL Server Express. Also, I enabled creating User Instance form SQL Server Express, Nothing is working. I am already added to the Administrator Group locally on my Laptop. Still same problem. Checked this article: http://msdn.microsoft.com/en-us/library/ms254504.aspx, same problem. I enabled User Instances and also tried to Disable User Instances. When I disable user instances, and then try to connect from VS, I get a different error, which is asking to enable user instances.

WebFaultException throwing a "not handled by user code" error and returning an HTTP 500 to the clien

  
I am trying to return a BadRequest and simple message when implentation throws an error in a WCF REST service, but the WebFaultExcption itself is throwing an exception and returning an HTTP 500 instead. Any ideas on why this might be happening? Here is a short code snippet: [WebDispatchFormatter] [WebHelp(Comment="Initiate an immediate or callback appoinment request")] [WebInvoke(UriTemplate = "InitiateContact", Method = Verbs.Post)] public string InitiateContact(AppointmentRqst rqst) {      string ret = string.Empty;      rqst.DeviceId = Helper.GetHttpAuthHdrDeviceId();      try      {          ret = impl.InitiateContact(rqst);      }      catch (Exception ex)      {          throw new WebFaultException<string>(ex.Message, HttpStatusCode.BadRequest);      }      return ret; }

"Format exception was unhandled by user" error. . .please help. . urgent!

  
Hi to all developers. I'm developing a survey site and i got this error 'Format exception was unhandled by user'. .  please help me deal with this. . any help is much appreciated. .here is where the error occured(2nd line):If Not Request.QueryString("DeptCode") Is Nothing Then            Dim DeptCode As Double = Double.Parse(Request.QueryString("DeptCode"))            Session.Add("DeptCode", DeptCode)        Else            Response.Redirect("default.aspx")        End Ifthanks in advanced. .

Collect Data from a user task error

  
Hello, I am a new admin and I'm hoping you can help. I have used the Collect Data from a user Action in a workflow in Designer. I get no errors in saving or publishing. My workflow works find and sends me the task assignment as an email when I test. However, I then run into three problems which (together or separately) prevent me from moving forward in the workflow. 1) When I click the "edit task" button located in the task email, my entire Outlook locks up and must be restarted. (I am using outlook 2007 and Sharepoint Foundation 2010) 2) The email says in step 3 to use the "Open the Task" button to mark the task complete. I cannot find this button anywhere. 3) When I go directly into the task, I can view it but I can find no way to "complete" the task without editing it directly. This gives me an error window that says, "Type 'Microsoft.SharePoint.WebControls.SPDataSource' does not have a public property named 'UseServerDataFormat'. "

Interesting error message with content organiser: Cannot resolve mailbox (null) to a valid user

  
Here is a site with content organiser site feature enabled, as well as the email integration feature. Emails are successfully delivered to the "Submitted Email Records" list, but is never routed to the Drop Off Library. (the content organiser web service works fine and the drop off library works as a custom send to destination and happily processes its rules. If I turn up the debug juice I get the error "Cannot resolve mailbox (null) to a valid user" for every item in any "Submitted Email Records" in the site collection. Area: Document managagement Category: Content organiser EventID: 8000 Message: Cannot resolve mailbox (null) to a valid user I have temporarily worked around the problem by email enabling the drop off library but it creates an intermittent race condition (similar to certain workflow and event receiver situations), so its not a real solution (and in fact I assume thats why the Submitted Email Records hidden list exists in the first place). I've run procmon, specifically focusing on OSWTIMER and nothing interesting shows up at all. The error message is intriguing and I can't really think of what it is trying to do. In troubleshooting I noted that this farm had configured inbound email but not outbound email. I have since rectified this and de/reactivated the content organiser features and reset the timer service and IIS, b

Critical Error with User Profile synchronization timer job

  
Hello! We are currently running SharePoint 2010 on Windows 2008 R2 servers. Our User Profile Service and User Profile Sync Service are currently running, and profile imports work fine when kicked off from Central Admin. However, the profile sync timer job always fails with the following Application Event error: Event 6398, SharePoint Foundation The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID 340e8ca2-6f3b-4bd8-80f2-0fe011709805) threw an exception. More information is included below. Generic failure Looking at the ManageUserProfileServiceApplication.aspx log, indeed the only imports visible are ones which have been kicked off manually in Central Admin. The failed scheduled imports are not even recorded to this log. The ULS entry associated with this error is as follows: 08/31/2010 17:11:17.32  OWSTIMER.EXE (0x0CD0)                    0x0C04 SharePoint Foundation          Timer                          6398 Critical The Execute method of job definition Microsoft.Office.Server.UserProfiles.UserProfileImportJob (ID 340e8ca2-6f3b-4bd8-80f2-0fe

Best practice for user defined error messages in SQL Server 2005/2008 --Need help

  
My requirement is to setup a standard practice for our team in handling DB erros and also  user defined messages. We are handling exceptions using Raiseerror method with in Try and Catch blocks.  For user defined message, we are using Sp_addmessage to add our application specific error/warning messages with error codess>80000.  Ex: 80001 | Company name already exists. please check. Here is the sample code ********************************************************************* CREATE PROCEDURE [dbo].[usp_CompanyProfile_insert]  -- Add the parameters for the stored procedure here  (@company_name VARCHAR(50),  @company_code VARCHAR(3),  @user_id INT  ) AS BEGIN  -- SET NOCOUNT ON added to prevent extra result sets from  -- interfering with SELECT statements.  SET NOCOUNT ON;  BEGIN TRY -- Begin Try Block      -- Validate company name   IF EXISTS (SELECT company_id FROM companyprofile WHERE company_name = @company_name)    RAISERROR(90021, 16, 1)      INSERT INTO companyprofile (company_name,       company_code,       createdby)   VALUES(@company_name,     @company_code,     @user_id)    END TRY  -- End Try Block &

User permission error

  
I have a VS 2010 website that is reading and writing to a SQL Server 2008 filestream. By filestream, I mean that I have a table in a SQL Server 2008 database that is configured for filestreaming (ie - the table has a RowGuid column and a varbinary(MAX) column that is filestream enabled). The website is able to read and write to the filestream just fine and has been doing so for months now. However, there is one minor detail about using the filestream that has plagued me since the beginning, and were it not for a hack - at least I consider it to be one - then my filestreaming would not work. The problem is that for some reason when my website makes a connection to the filestream (via the .NET SqlFileStream class) it always attempts to authenticate with the name of the webserver.For example, I have a brand new web server called WebSrvPrd01 that I just placed my website on (the one that is using the filestream). When I try to do anything that uses the filestream (either writing or reading to) it throws the following exception:Login failed for user 'SUPER-NT\WebSrvPrd01$'.At this point, I then have to go into SQL Server and add the domain and user SUPER-NT\WebSrvPrd01$ to the database and give them access rights accordingly. After having done so the website will have no problems and the filestream works wonderfully. However, I don't like this solution! It presents a bit

People Picker gets error when selecting user from a trusted domain(one way forest trust)

  
  Hello all,   Our current setup is SharePoint 2010 Foundation server in one external forest(Trusting forest), and trying to have users in a separate internal forest(Trusted forest) access the site. The external forest's DC and SharePoint server are in a DMZ separated by a firewall with the internal forest's DC and users. A one way transitive forest trust was successfully created and has been validated. On SharePoint, we're ran the sts commands to set the setapppassword as well as the peoplepicker-searchadforests adding the domain that the SharePoint server is in, as well as the trusted forest. An iisreset was issued after running these commands. In SharePoint, we can then search for users from the trusted domain, and select the users in the Select People page, but when hitting the final Ok, an error is received: An unexpected error has occurred in which a correlation ID is provided. Reviewing the SharePoint logs we find the following: <!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520081665 -1073717157 41 0 66047 0;} /* Style Defin

User Profiles Error - Failure trying to synch web application... No User Profile Application availab

  
Hello, everyone, I've got an issue I can't seem to figure out. every since I set up my farn and configured the User Profile Service Application, I've been getting the following error every morning at 6:11 AM: Log Name:      Application Source:        Microsoft-SharePoint Products-SharePoint Portal Server Date:          9/3/2010 6:11:23 AM Event ID:      5555 Task Category: User Profiles Level:         Critical Keywords:      User:          NS\spfarm Computer:      jxnpvsp01.NetworkStreaming.local Description: Failure trying to synch web application 3f3f96cc-8bbd-439c-ae80-1ed633c6ec1d, ContentDB 6ef952b5-3312-46a2-b3e1-1b5218b5d209  Exception message was Microsoft.Office.Server.UserProfiles.UserProfileApplicationNotAvailableException: No User Profile Application available to service the request. Contact your farm administrator.    at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()    at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PerfmonInstanceHandle()    at Microsoft.Office.Server.UserProfiles.ContentDBS
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend