Security :: How To Find Out The Type Of User
May 11, 2010web.config
[Code]....
i am allowing only tht particular users.In my code how to find out the current user type.And wht is the difference between
[Code]....
web.config
[Code]....
i am allowing only tht particular users.In my code how to find out the current user type.And wht is the difference between
[Code]....
I need to show the user a different page when he loggs in for first time alone..
How can i do this..
For some reason I couldn't find it anywhere, how do I find the current user's role in vb.net?
View 3 Replies- I started an empty ASP.NET 3.5 website
- I included the assembly reference <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- I included using System.Web.Security;
- I want to use the following code to add a confirmation code to an email
protected void CreateUserWizard1_SendingMail(object sender, MailMessageEventArgs e)
{
MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);
string code = user.ProviderUserKey.ToString();
e.Message.Body = e.Message.Body.Replace("<%ConfirmationCode%>", code);
}
- I know some changes were made to the location of MembershipUser according to this -->
[URL]S(ywiyuluxr3qb2dfva1z5lgeg))/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770156
I have only username. and want to check and grab the password from the database. It is BEFORE LOGGING IN. so I don't think the build-in asp.net functions could be used, right?
View 5 RepliesI want to execute some logic if the Logged in User can view a page "~/MyPage.aspx". IF the logged in user should be elligible to view the page is determined by the role based security I configured in the web.config file. There are many methods to find out if the user is in role XXX or not. But I did not find any method to find out if the user can view a page or not ahead of transferring the user to that page. Maybe I will hide a link to a specific page to the logged in user if the user is not elligible to view that page if I know the technique i am asking here to know.
View 1 RepliesI have a web site that is using windows authentication. 'Enable anonymous access' is unchecked. It works when I call it through Visual Studio but when I put the site on the server I get the following error:
Unable to cast object of type 'System.Security.Principal.GenericPrincipal' to type 'System.Web.Security.RolePrincipal'.
Here is the offending line:
System.Security.Principal.GenericPrincipal genericPrincipal = (System.Security.Principal.GenericPrincipal)HttpContext.Current.User;
guess it's straightforward. On page load, i wanna check the group of which a particular belong to. Say, someADNameeckham belongs to Account. In that case, I only wanna get "Account". But I have no idea how to get the group name of a particular user belong to. It's for LAN web portal so I guess security is not a very big concern here.
View 5 RepliesI'm receiving the following error when deploying a feature containing ASP.NET pages to our development SharePoint servers: System.InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'odsYears' could not be found. Our .dll is being deployed to the GAC and our pages are being deployed to the the respective Features directory in the 12 hive. We are not receiving this error on our Sandbox SharePoint server. I disassembled the .dll to be sure the class was being deployed and everything looked ok. why this would not work on one of our SharePoint environments?
View 2 Repliesi want to disable validation controls on some conditions. how can i find that a control is inherited from "BaseValidator"?
note all validator controls are inherited from BaseValidator (+)
How to find the control type in javasccript?. Say if i have an ASP.NET LinkButton and i wanna find control type from the javascript. How can i do that. I tried using typeof(), but it giving me an object back. and i tried
var control = document.getElementById(Id);//Id is the ClientId of the Linkbutton alert(control.type);//this is empty.
i am working in asp.net and csharp, we have 10 user, but certain user only need to put dataentry. how to enable and disable based on the user to access certain form ,like add, modify view options.
View 1 RepliesI am using Itext sharp to create a pdf. I am adding an image and I keep getting this error
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, ersion=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
it is this bit of code that is causing this
[Code]....
If i comment this out, the PDF builds and no errors are thrown (there is just no image)
I don't understand cause I am am trying to do is read a file.
I'm writing applications on Facebook located on an external website ASP.NET C #. The application should check whether or not a person likes my Fan Page (page) on Facebook, and if he or she doesn’t like it needs to like it before using this application. How this can be done using the Graph API and ASPSnippets Facebook API.
View 1 RepliesI have table called ROLE with fields (id,name,permission) example values (1001,madhu,hr)
I have another table called LOGIN with fields(id,DOB,password) example values(1001,24101989,madhukumar)
What i want is , if i login using the LOGIN table ,it check the id and permission in the ROLE table , if the permission is 'hr' it enable to access the menu , or if the permission is any other it just print the error message ("no permission")
Note: menu is placed in master page , but login is not in the master page ...
I have LOGIN PANEL for student, and I want to disable it in different page. And only the admin can enable and disable it. I dont know the logic behind here.
View 1 RepliesI have a signup page and Main page in my web site. i want to prevent an user to type directly the Main page URL, user should have access after signup/login.
View 1 RepliesWhen i loading modules from different places i injected them to controller factory, but when it is trying to load strongly typed views it can't find model type that is contained in module assembly.I made new ViewEngine and now it looks in right places but it cant load strongly typed views.
So as i understand i need to show the view where to find class model. If you have any other ideas please tel me. And one more i need this problem to be solved for WebFormViewEngine and RazorViewEngine.
Existed MyControl1.Controls.OfType<RadioButton>() searches only thru initial collection and do not enters to children.
Is it possible to find all child controls of specific type using Enumerable.OfType<T>() or LINQ without writing own recursive method? Like this.
I have a gridview with a nested placeholder in each rows. I nested some checkboxes in each placeholders in each rows dynamically, so their ServerIDs are not the same (I dont want to use nested gridview). at the end in a button event I want to count checked checkboxes in gridview while I can not use findcontrol() method in each rows to find checkboxes due to their different ServerIDs.
View 3 RepliesHere is my code
[Code]....
"fileUpload" is the FileUpload ASP.NET control. The SaveAs method writes the user uploaded file to a specified location on the server. IT WORKS. That tells me that the ASP.NET process has the proper write permission to write to the file.The next line uses an assembly called PdfSharp which you can use to open PDF files and manipulate them. In this case, the line simply opens up the user uploaded file. That is where the error occurs. WTH?
It works on my production machine. It does not work on my local machine. It USED TO. It was never a problem before.So why would it be fine to WRITE to the server, but trying to open a file give an error? Makes no sense. Googling yields a suggestion to put <trust level="Full" originUrl="" /> under <system.web> in web.config. It does not work.
Does any one know the cmd line call to retrieve the existing RSA key container name so that I can export these RSA keys to another machine?
View 2 Repliesi have developed one website,
this website should be free of cost to india.
if any other abroad countries, it should not access without paying the money...
how can i do this concept...
I want to have a function that runs once when a user logs into my system. It should run once everytime a user logs in. I don't handle my logins with Membership, just with Authentication. How do I accomplish this?
View 1 RepliesI have a .Net web service which is being relocated onto a Windows 7 machine running IIS 7.I have set up an application under the default web site and pointed it to the correct location, however when I try to execute a call to the web service, I get a message as follows:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Registry SubKey softwareardexconnections.net not found.
In the past when I had this error, all that has been required to fix it is to set the permissions on that registry sub key to allow read access to the anonymous IIS user. I have given the Everyone group Full Control of this sub key in an attempt to get it working but I still get the same error.This is my first experience with Windows 7 and IIS 7 and it seems quite a bit has changed, so I'm probably missing something.