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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Passing UserName and Role info between Web Applications - what is the best way?

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net


I have a Security (web application) that takes care of the user logging in and checking their membership/role info.  This application brings up a page that displays link buttons to the other web applications that the user is allowed to access.  I want to pass the UserName and the user's Role to the web application that the user selects.  I don't want the user to be able to access the other web applications directly without logging in the Security application.  Also, I don't want them to be able to save the link to favorites to access those other applications directly.

I tried Cookies...the persistent cookie disappears when I hit one Link Buttons (I do get to the other web application).  View State didn't seem to be the way to go from what I read.  I read about Session Sate, Application State, Url encoding.  Some of my web search brings up stuff that says this is "no longer supported" because it left there for older version.

All applications use the same server IIS location in my company's intranet.

I've read and re-read How to Manage State (ASP.NET 3.5) and I am just confused as to what way would best apply to getting the user name and role to the next web application. 

I am a novice with Web Applications. I think just need some guidance to point me in the right direction.

View Complete Post

More Related Resource Links

Reg passing info from aspx page to New form.aspx page of list in sharepoint



Initially i have Newform.aspx in the list.In that when i am clicking an icon that is available in Rich Text Box Editor it is taking me to another aspx page.In that page i have custom web part with One Field Control to upload  and one Button to upload the files.Now my requirement is as soon as after uploading these file from web part i should display the file names in the Rich Text Box.Please share your ideas of capturing file names in the web part and getting those file names in the rich text box in the newform.aspx of the list please let me know

Thanks & Regards,


Role Provider mess up Welcome [username] on wss


Hi,I have a role provider, and this is how i wrote for my GetRolesForUser(string username), now the problem is on the wss page, on the top right corner, it shows Welcome "System Account" Instead of the logged in user. And I checked it, after RunWithElevatedPrivilage, The CurrentUser is System Account,How can I make the welcome to show the current logged user?

Thank you

public override string[] GetRolesForUser(string username)
      //string[] s = ws.GetRolesForUser(username);
      //return s;
      List<string> domainGroups = new List<string>();
      var webContext = SPContext.Current.Web;


          using (SPSite site = new SPSite(webContext.Site.ID))
            //siteEval = site.OpenWeb(site.

Custom Role Provider - Roles.GetRolesForUser(userName) raises exception


Hi All,

We have configured Claims based authentication in our application and We have extented the RoleProvider. When we call the Roles.GetAllRoles() method it returns all the roles available in the aspnet_Roles table. When we call Roles.GetRoleForUser(userName) it raises the following exception.

Exception of type 'System.ArgumentException' was thrown.
Parameter name: encodedValue

   at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue)
   at Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider.GetRolesForUserBestEffort(String username)
   at Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider.GetRolesForUser(String username)
   at System.Web.Security.Roles.GetRolesForUser(String username)
   at Dsp.SP.ContentManager.GenericPublishedContent.BindGridPublicGroup(String selectedNode)

When we debug our Custom Role Provider project the breakpoint hits the GetAllRoles() method and it does not hit the GetRolesForUser() method. So we are not sure whether the overridden method is called or not?

Do you load content based on Role or Username?




I want to load content depending on what "Permissions" the user has that is currently logged in.


Lets say i have a bunch of links, do i load the links based on the username or based on their role?


ie.) i want links 1 2 3 to appear if role/username is "Admin" and i want link 1 to appear if role/username is "User"


Do i load based on if(User.Identity.Name == "Name") or do i do something similar with roles?





Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

ASP.NET Best Practices for High Performance Applications

This article lists the techniques that you can use to maximize the performance of your ASP.NET applications. It provides common issues, design guidelines, and coding tips to build optimal and robust solutions.

Business Modelling and Web Applications and extending UML

UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.

Building Layered Web Applications with Microsoft ASP.NET 2.0 - Part 1

"Building Layered Web Applications" that shows you how to build N-Layer applications with Microsoft ASP.NET 2.0. These articles teach you how to design, build and use custom business objects in your web application. The target audience for this series are developers that are ready to make the switch from using SqlDataSource controls to ObjectDataSource controls with custom business objects. Experience with ASP.NET 2 and C# is necessary while some knowledge about object oriented design certainly helps. The design I am going to show you in these articles is a simplified version of a design you would use in a real world application. It doesn't feature all the necessary functionality your application needs, but instead focuses on the underlying concepts.

How to improve the performance of ASP.NET MVC web applications

It is an in depth analysis of a Digg-like site and how it went from serving (on a test machine) 6 req/sec to 390 req/sec.

The biggest gain, 74 req/sec to 390 req/sec happened when he introduced data caching and another 25 req/sec where gained when he introduced the compilation of LINQ queries.

Like Celebrities - info about all celebrities

Like Celebrities - info about all celebrities

WCF Callbacks Hanging WPF Applications

I have a WPF application that communicates with a pretty basic WCF service. Whenever a callback is issued in the middle of a request, the WPF application completely hangs. It's obviously a synchronization issue, however I've gone through the forums and articles and set every imaginable attribute on every imaginable object with no successful outcome.

Multithreading in .NET Applications, Part 3

Multithreading is a powerful design tool for creating high-performance applications, especially those that require user interaction. Microsoft .NET has broken down the barriers that once existed in creating multithreaded applications. The last two installments of the .NET Nuts & Bolts column were

10 Tips for Writing High-Performance Web Applications

Writing a Web application with ASP.NET is unbelievably easy. So easy, many developers don't take the time to structure their applications for great performance. In this article, I'm going to present 10 tips for writing high-performance Web apps. I'm not limiting my comments to ASP.NET applications because they are just one subset of Web applications. This article won't be the definitive guide for performance-tuning Web applications-an entire book could easily be devoted to that. Instead, think of this as a good place to start.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

Best Coding Techniques To Improve Performance for SharePoint Applications

As more developers write custom code by using the SharePoint Object Model, they encounter common issues that can affect application performance.

The following areas reflect the main issues encountered by developers as they write custom code by using the SharePoint object model:

§ Disposing of SharePoint objects

§ Caching data and objects

§ Writing code that is scalable

Different types of applications in WPF

With Windows Presentation Foundation coming closer to its release date with Vista almost being upon us, more and more people are taking a look at programming in WPF

Finding username


Im running a query where it selects a property from the user with the matching username but i dont know how to find out the username of the currently loggedin user.

Please Help!

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