Web Forms :: Web Parts And Anonymous User And Authenticated User Is Displayed Differently?
Mar 21, 2011
the Web Part for anonymous user and authenticated user is displayed differently. I faced this problem twise. First time when used Silverlight control in the Web Part and second time when used devexpress control in the Web Part. In both cases problem was with displaying for anonymous user. Silverlight control didn't display. Devexpress control lost it's styles. Both controls had properties that pointed to files. Silverlight control property pointed to the XAP file, and Devexpress control property pointed to the CSS file. It seems to me, that for anonymous user the Web Part cannot find this path or doesn't allow to link to other files.
I deployed a website where a logged user or an anonymous user can select data and download a XML file. The website generate the XML file in the server and then deliver it.
It works fine in my development environment, but after deployment, the anonymous user can download the file, but the logged user receive this error:
System.UnauthorizedAccessException: Access to the path 'd:HostsLocalUserheringerwebsiteUpload20110107094051.xml' is denied.
It is weird that as anonymous i can do it.
The website server help states this:
"Grant write, modify, delete access rights on website's folder
Your website executes under unique user account that by default has full control over the website's folder. So your application can create, open, read, write and delete files and folders inside of your root folder.
There is no need and no way to change this permissions.
If, when running ASP.Net application, you still unable to create file or update it, you have to check your Web.Config file for "<Identity impersonate..." tag and remove it.
The only exception is when the application tries to modify a file or folder in "Application_Start" event of Global.asax file. This is by design that user authenticated only after the Application_Start even. Before the user is authenticated your website runs under an identity of Application Pool which is "Network services". That account doesn't have access to the folder of your website.
To make it work you eather have to move the code that tries to modify files or folders out of the "Application_Start" event of the Global.asax file or inside the event you'll need to impersonate your user by code."
But i am not using impersonate and the tag is not in my web.config.
I am using form authentication in my website. I have a scenario wherein the user is authenticated but the session has timed out. So, i would like to initialize some session variables in Session_Start of Global.asax (First i check if Request.IsAuthenticated=True). For that i required the name of the user who authenticated. On .aspx pages we can get it using Page.User.Identity.Name but how to get it in global.asax page.
need to let users to generate online questionnaires that could be answered by other users. I was wondering if this could be done using the WebParts.I have a custom application with already set up database. I do not use any form of Membership Provider (I have a custom made form of user authentication, I did not want to be bounded by the rigid frame of the ASP Membership). As far as I know Web Parts uses db (called SharePoint ?) to store the state etc. so this might be the first problem because I do not want to modify my DB just for the sake of WebParts (I assume it would require a whole lot of changes).So I was wondering if it would be possible to use Web Parts only as a form of "ASP code generator" e.g. I could create the questionnarie using WebParts and then export the result somehow (?) to print an ascx/aspx file or code.If this can not be done, can anybody tell me if there are any components that would be useful here? Some sort of toolkit where one could create asp code online? (with textboxes, checkboxes etc.).
I have a problem with using login controls form authentication ! as my website serves some pages for guest users(Anonymous user) and some pages are for only secure user(they must have to login for those requested pages)...... my problem is this that when i apply form authentication in web.config file to login control then visual studio directly shows only login page where i want that in general case only : guest user pages must be shown and if user clicks on login then after login the requested page he may open !
I am using web parts using asp.net c# 2.0 with Ajax 1.0.
I am dynamically creating and loading web parts in my code behind. Some of these web parts are pure html others are user controls. Its all working well but with one annoying issue.
When I add a new web part / remove one ( from my web part collection) this change is not reflected in the portal. Say when you add a new web part you would expect it to see in the catalog. But its not there. When I remove a web part from my collection it still appears in the portal.
However, If I delete the user's setting in the aspnet_PersonalizationPerUser table then the change is visible!
I have a web user control that contains 2 text boxes. i would like to be able to have their values persisted using the personalizable attribute, but dont want to use my user control as a web part. Can i implement the personalizable attribute on a text box in a user control without using web parts?
i have a page where i have some text boxes and some dropdowns at the top and a Gridview(in the other page) in a Iframe at the bottom.the problem is that when i see this page in IE 8 and Mozilla 3 i can see them nicely formatted.but when i see it in IE 8 with compatibility mode on then the boxes are sqaushed and the columns of the gridview are also squashed and the whole page looks bit clunky.
I have a requirement that whenever a user logs onto a website using forms based authentication [FBA] that the site checks whether they have a related domain NT user record. There will be a matching lookup table between the ASPNETDB membership database and related domain accounts for users.Whenever an FBA user logs in and a related domain account is located then the member should be redirected to an alternative site / URL which is Windows NT authenticated rather than FBA. Before transferring them I would like to be able to pre authenticate them on the windows domain rather than an additional NT Login dialog box coming up and asking them to enter the related NT credentials.Is it possible to programatically preauthenticate using NT credentials before redirecting a user to an NT authenticated site?Note: This isn't technically a single sign on style scenario. The FBA / NT authenticated sites are not related other than the relationship between the original FBA credentials and the NT credentials lookup.
Followed the code sample of Chapter 10 (Logging in) of the Book, Microsoft ASP.NET 2.0, I created an ASP.NET 3.5 website with Forms Authentication. The sample code used Website Administration Tool (WAT) to manage the users, roles, and authorization.When running in the ASP.NET Development server environment, I can first login, then click to open the links for each for the 3 roles.
However when running the sample code in the IIS server environment, I can login but can not open the links for the role subfolders.Clicking each link popped up an error message for opening a login.aspx from the specific subfolder. I don't have a Login.aspx file in each subfolder.The 3 role subfolders were configured as the virtual folders in the IIS Server. Why the sample code worked fine inASP.NET Development server environment, but got an error message from theIIS Server environment? Why an authenticated user can not open the subfolder homepage?
I have a WCF service that will be using basic authentication and would like to be able identify "who" is trying to use the service. I know that the HttpContext.Current is NULL and in the WCF service, but do not know what the alternative is to get the username.
I have created a website which has Secure folder in which i have got a form which only "admin role" users can see. Now that form will appear if login is successful and it works great, if password or username is wrong then again the loginForm will appear which works great too.
Now the problem is if the users which are not in "admin role" enter the user name and password correctly, instead of coming back to the login page and showing them the "Not Authenticated" message, it gives me an error that myWebsite/login.aspx is not found. I think this is because the name for my login page is "AdminLoginPage.aspx" and which is not found and hence it shows me the error. I dont know where to change the login Page name to "AdminLoginPage.aspx"
I have a web application on IIS that will authenticate using windows authentication (Active Directory). So when they access the application http://iisserver/webappname/ it ask for username pwd and domain. (currently working) How can I get information of the authenticated user in the web app through c#?
I am trying to integrate my asp.net 4.0(non MVC) website with facebook. I want to retrive the authenticated user info.The samples listed in facebooksdk is based on MVC. i tried to implement it in my website, but getting errors. i am struck.If anyone implemented the facebook connect logic and retrieved the user information using facebook-c#-sdk, please help me how to do this.I tried the same using facebooktoolkit, and i am able to retrive the user info. but the toolkit is having issues with .net 4.0.
I have Forms authentication setup for an ASP.NET 4.0 application on http://example.com - we'll call it MainApp. I also have an ASP.NET 4.0 app running on http://static.example.com which (let's call it SubApp) doesn't have access to the main app.
Now, SubApp needs to figure out usernames of users who first logged in to the MainApp and then came to SubApp. I thought that it's enough for those two apps to have the same machine keys and for the SubApp to specify in web.config, so it could read the MainApp's authentication cookie and get username from it.
I did a simple test and when I try to hit some page on SubApp it keeps redirecting to http://static.example.com/login.aspx - which doesn't even exist not specified in web.config. Apparently my approach doesn't work, though I don't understand why - main domain's cookie should be accessible on a subdomain, right?
I have an ASP.NET application where user is Anonymous when he connects to website. Also I have a printing server inside network. I want to let this user to print to the network printer.
In order to print I have to use File.Copy command. When I do this I get "Access denied". So I tried to impersonate the user with credentials of user that is inside domain and has the rights to print to that specific printer.
The problem is this user has to be Administrator, and I cannot let him be the Administrator. When this user is not Administrator then the printing is not working ("Access denied").
I tried to use Network Credentials but I don't know how to set credentials to command File.Copy. This command doesn't have any extensions or overloading for credentials.
I am building a RESTful service using WCF. I basically want to save information about a user when they authenticate to the WCF service. For example I want to save their first name, last name, account number , and password in order to access the information in other requests in the same session. Since this information is sensitive I can not store it in a cookie.
I don't want to use asp.net session state because I plan to run this WCF as a Windows Service. Is there something (class, Assembly) I can use that can save user information and retrieve it per request or do I have to create a custom solution that will create an entry in a database every time a client authenticates to the WCF service.