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

Post New Web Links

Problem of access when changing Roles

Posted By:      Posted Date: November 03, 2010    Points: 0   Category :ASP.Net

Hello friends,

well i have a simple application using an authentication (user and password) before accessing and there are several roles bound to each user.

in my web.config i have configured the acces for each page according to each role, this is an example below:

<location path="Home.aspx">
       <allow roles="administrator,role1"/>
       <deny users="*"/>
<!-- -->
<location path="admin.aspx">
       <allow roles="administrator"/>
       <deny users="*"/>

and i have 2 users:

1: admin (default role: administrator)

2: guest (default role: role1)

my problem is as follows:

if i give acces to the user "guest" to open the "admin.aspx" page with changin him his role from "role1" to "administrator", this one do not function except if i r

View Complete Post

More Related Resource Links

Problem with changing language using culture info


I'm using the following msdn article to use different languages in my web application:


I'm following the instructions step by step in VS 2010, and it creates the resource files exactly how it's supposed to. 

However, when I run the program it just doesn't apply it. I don't see the different values from the resource file. 

If I leave my resource file name as sample.aspx.resx, it works. But when I change it to sample.aspx.en-us.resx, it doesn't work. I'm supplying culture from the aspx page's Culter and UICulture properties. I'm being very careful in choosing the correct file name, as that could be the issue,  but it just doesn't work. I also tried changing the culture in the backend code this way:

Problem connecting to SQL Server 2008 R2 Express from Access 2007

I have a problem with SQL Server 2008 R2 Express with MS Access 2007. I am running Windows 7 with 8 gigs memory. I installed SQL Server 2008 R2 Express. Do I now need to install SP1 because I am running with Windows 7? I can open SQL Server using the Management Screen but I cannot connect to MS Access 2007 using SQL Server Express as the database. When trying to connect to SQL Server from Access 2007, I keep getting the message that SQL Server 2005 cannot be found. It will not allow me to sign onto sql server 2008 stating that it cannot be found. Do I have to now run the SQL Server 2008 R2 Express SP1? Is there an upgrade to MS Access 2007 which will allow me to use SQL Server 2008 R2 Express?

Problem changing/upgrading properties on WebParts that have already been deployed and added to Share

I have created two custom webparts which I deploy as a Feature within a Solution.  These webparts have been added to various pages on my site.  Due to design changes, I upgraded the webparts with some new functionality and some other changes to the webpart properties, such as the WebPart title, title icon and catalog icon.  After I have retracted/deleted the old solution and re-deployed the new solution (and activated the feature) the webparts have been upgraded fine, however, the webpart properties were not changed for any webparts that were already added to pages.  I can add new instances of the webparts and they have the updated properties (and also show correctly in the wp gallery and catalog). Is there a step I am missing in order to upgrade any webparts (namely the properties) that have already been added to pages?  Or is this something I have to take care of programmatically somehow to workaround the upgrade problem?

Problem with access to a user in AD group

Hi all, We are managing our security in Sharepoint (WSS 3.0) with AD groups instead of Sharepoint groups. This worked fine until now. For an unknown reason, one single user from an AD group cannot access a page (while other users from the same group can). The group is also a distribution list in AD (so it's a security group and distribution list for emails). It includes several other distribution lists such as: L-All-Corporate-Employees    L-Administration          User 1          User 2           ...     L-Accounting         User 1         ... ...   So far I never had any issue with that kind of approach,  but yesterday we published a new web part page and wanted only the corporate employees to get access to it, so I broke rights inheritance on the page and added the L-All-Corporate-Employees group with View rights. As I already said, I tested with one user from the group (let's say from the L-Administration sub-group) and it works, now I receive an email from another user (let's say from the L-Accounting sub-group) which tells me he doesn't have access... But they're all part of the L-All-Corporate-Employees group, so they should all

Access violation in wpfgfx_v0400.dll - How to find the problem?

I have an access violation exception generated inside wpfgfx_v0400.dll. I have the minidump loaded in visual studio 2010 with all my program's symbols loaded in debug mode. Unfortunately, the stack is of little use. I have searched on the net for help but I could not find anything. I would like to know what I can do from here. Here is the stack for the thread that caused the access violation. Unhandled exception at 0x778b64f4 in WERE8E3.tmp.hdmp: 0xC0000005: Access violation reading location 0x24448900. >   ntdll.dll!778b64f4()      [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]        wpfgfx_v0400.dll!6abb6d2e()          wpfgfx_v0400.dll!6ab9e2d5()          wpfgfx_v0400.dll!6ab22c98()          wpfgfx_v0400.dll!6ab22c98()          wpfgfx_v0400.dll!6ab22c98()          wpfgfx_v0400.dll!6ab23dca()          wpfgfx_v0400.dll!6ab22dbb()          wpfgfx_v0400.dll!6ab291e2()    

Problem with ODBC from MS Access 2007 to MS Sql Server 2008

Hi experts, I need some help with ODBC Connection Settings from MS Access 2007 to Sql Server 2008. Here is the Scenario, I have created a Database(StagingDB) with 5 tables on SQlServer 2008 and I have  Developed an MS Access 2007 Front End using Linked tables and ODBC to Insert/ Update data into these 5 tables. This is just working fine in my Dev database. ODBC Connection Settings are pointing to my DevServer. All I wanted to do now is, I want to point the ODBC Settings to the same database on my Test Server and then to Production Server. I have Changed the Server name in the ODBC File to point it to my Test Server and If I try to Insert  some data into test server its stil going into the database on Dev server. Is this the right way to do. Please help me with this. thanks In Advance..

Permissions:disable controls by roles(access pages too)(dynamically :each new role has special grant

HelloI have an application of many pages of consultation and same time I have a module of adding users by roles and creating accounts by role.(the application is ready but i cant manage the roles)the tutorials that i found are very useful to manage roles but its roles fixed before(administrators,supervisors)(http://www.asp.net/security/tutorials/creating-and-managing-roles-vb) if I add a new role (agent) i want to grant to this new role a new access to pages(different access than admin and supervisor) and disable new controlswhy not using checkbox to every new role checking a field related to databaseis it possible?if yes ,how can i begin?Thanks

DetailsView edit problem after changing database

Hello!I had a DetailsView control for editing records in a Access 2003 database. I transfered the database to MS SQL 2008 and using the same code does not work - after clicking edit nothing happens (no error) and the record is not updated.ASP code:<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Urejanje kontaktnih podatkov </h2> <p> <asp:TextBox ID="txtKontaktID" Visible="false" runat="server"></asp:TextBox> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:conKrik %>" ProviderName="<%$ ConnectionStrings:conKrik.ProviderName %>"  SelectCommand="SELECT tblKontakt.*, tblStranka.strSkrajsanNaziv FROM krik.tblKontakt INNER JOIN krik.tblStranka ON tblKontakt.StrankaID = tblStranka.StrankaID WHERE ([KontaktId] = @id)" UpdateCommand="UPDATE tblKontakt SET strIme = @strIme, strPriimek = @strPriimek, strPoslovnaEnota = @strPoslovnaEnota, strTelefon = @strTelefon, strFaks = @strFaks, strMobitel = @strMobitel, strEmail = @strEmail, rmkOpomba = @rmkO

Outlook web access - my calender log in problem

Hi there. We have an intranet solution built on Sharepoint 2010 enterprise. I'm trying to connect the My Calendar web part(found under Outlook web access web parts) to my clients outlook exchange -server. I've set the server to be https://webmail.[company].fi/exchange and the credentials in the web part properties. I get the signing in -part to show on my web part but for some reason cannot log in. There is no error or notification about what went wrong with the login. When I open up a new tab and go straight to https://webmail.[company].fi/exchange and log in with the same credentials that I tried on the web part, I can log in. Now when I go back to my original tab -having the my calendar web part- and refresh, the web part suddenly works and it displays the calendar as it's supposed to. Why can't I log in directly in the My Calendar web part? What could be the problem? Thanks in advance

problem with changing cssclass name using javascript

function DoFocus(fld) { fld.className = 'textboxFocus'; } function ChangeToFocus() { document.getElementById('<%=tbComment.ClientID%>').className="textboxFocus"; } button1.Attributes.Add("OnClick", "ChangeToFocus();")//Not working tbComment.Attributes.Add("OnFocus", "DoFocus(this);")//Working I have two methods to change a control's css class (etc. textbox), however, javascript method 'ChangeToFocus' is not working but I do need that function or something could do the samething (I can't use DoFocus(fld) function as it need to pass that control's reference)     Many thanks for your help! Ray

needed information about the roles of access for a cube

we have a cube (regarding insurance), which is accessed by users by an excel sheet? now they want to restrict the grand total view by the users depending on the user id, i.e there are AccountExecutives each AccountExecutive must be allowed to view only commision related to them. How can it be achieved? and where can I get the information related to the roles and the permissions to access dimensions and restricting access to data depending on user id s? (kindly provide as much detail as you can, because I am new to ssas)

Lost access to control members and roles


I am working on an application that resides on a development server on our internal network.  The application was originally written to use Membership and Roles.  We got busy almost a year ago before the app was finished, and now we are trying to get it ready to use internally.

The login page works just fine, but I have lost the ability to controls users and roles.  I am running Visual Studio 2010 Professional now on a Windows 7 VM.  I can open the application fine but there is no Web Administration Tool available for me to manage users or roles.  If I go to Website -> in Visual Studio, there is no option for ASP.NET Configuration in the drop down menu.  It simply isn't there.

How can I regain access to manage users and roles for this application?  We are using Forms authentication and the database resides on a  SQL Server 2005 instance on a separate box from the web server and my local VM.

Join Expression Not SHi All, I use Access 2007, and I have the following SQL problem: I have two t

Hi All,

I use Access 2007, and I have the following SQL problem:

I have two tables TransformerTypePeriodBOMProducts and TransformerTypePeriodProducts. The first table has 4 fields: TransformerTypeID, OutputProductID, PeriodID and BOM, while the second has the following 4 fields: TransformerTypeID, OutputProductID,PeriodID and AssemblyCapacity. So as you can see, there are 3 fields (TransformerTypeID, OutputProductID and PeriodID) that are in both tables.

I need to delete all records in the first table that have the field AssemblyCapacity in the second table equal to 0 (and of course have similar TransformerTypeID, OutputProductID and PeriodID fields).

I tried many trials, the last I got was:

SELECT TransformerTypeAssemblyPeriodBOMProducts.*
FROM ((TransformerTypeAssemblyPeriodBOMProducts INNER JOIN TransformerTypeAssemblyPeriodProducts ON TransformerTypeAssemblyPeriodBOMProducts.TransformerTypeID=TransformerTypeAssemb
lyPeriodProducts.TransformerTypeID) INNER JOIN TransformerTypeAssemblyPeriodProducts ON TransformerTypeAssemblyPeriodBOMProducts.OutputProductID=TransformerTypeAssembly
PeriodProducts.OutputProductID) INNER JOIN TransformerTypeAssemblyPeriodProducts ON TransformerTypeAssemblyPeriodBOMProducts .PeriodID=TransformerTypeAssemblyPeriodProducts.PeriodID
DELETE * FROM TransformerTypeAssemblyPeriodB

restricting access to a Pages on my web site using roles



          Can i restrict access to a particular page on my web site using roles or in any other way

Strange Access Denied Problem


I have SP2010 stup with a TFS portal. Brand new machine for the job. Installed 2008R2, Installed SP2010 when release, Installed TFS when released. Set the relative TFS groups up to people could see work items and so fourth in the portal. Added the relative users to the relative SP groups and it all works fine Except everyone bar me gets Access denied if they have been logged out of portal for too long. The way this is fixed is by me logging in.

I'll try to be clearer.

User A tried to log into the portal first thing in the morning.
User A gets Access Denied.
User A SMSs Me (the admin)
I log in and do nothing but login, don't touch a single link, don't do anything, Just login.
User A can now Login in.

User A can be any none admin type user. It happens to everyone.

This has been going on since the day it was setup. Basicly the day after VS2010 was released. It has not been a majour issue so far as we are only doing prep work for a new project so only a couple of people have been adding documents but thats about to change so I need to sort it out.

Any Ideas.



Why is there a problem of access denial?

I tried to add a new mdf object to my MVC web project. Yet it says Access is denied. Can someone tell me why this happens? Thanks.

StreamReader.BaseStream.Read() problem in Random access reading of file


I am trying to randomly access a file but not fully understanding this class.

I have

 // Seek to the beginning of the field

System.IO.StreamReader srFile = new System.IO.StreamReader(_FileName.PathAndFileName);

srFile.BaseStream.Seek(FieldOffset, SeekOrigin.Begin);

// Read the field

int FieldLength = Field.FieldLength;  

int BUFFER_SIZE = (int)RecordLength;

byte[] bBuffer = new Byte[BUFFER_SIZE];

srFile.BaseStream.Read(bBuffer, 0, (int)FieldLength);

string FieldValue;
FieldValue = bBuffer.ToString();

but bBuffer is numbers like:

[0] 32

and the value of FieldValue is "System.Byte[]"

I'm trying to get text as this is a text file.


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