.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

Membership.GetUser() using FireFox browser

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

I am finishing up my asp.net web application targeting .net 4.0. I am using VS2010.

I have deployed my application to a host server and now I am testing with multiple different browsers.

The first issue I ran into comes down to the following code:

            MembershipUser currentUser = Membership.GetUser();
            if (currentUser != null)

If I use IE, login and click something that causes the above code to execute then currentUser is NOT null. However doing the exact same steps in FireFox currentUser is null, even though I know I am logged in as my name and other indications on the webpage confirms I am.

Anyone have any ideas why this would be? 





Since originally posting this thread I have done more testing.

I placed a test button on a random page and the button click will update a label on that page indicating if the currentUser is null or not. This button works both in IE and in FireFox. Also both running locally and running on the host server.


So now I am looking at what is different about the one place it appears not to work so let me try to make this clear.

I use a component called Uploadify to upload images into a database. That componen

View Complete Post

More Related Resource Links

Membership.GetUser() issues

HI all, I've got a claims based SharePoint 2010 environment configured.  I'm able to register new users, login etc.  I'm now trying to get more detail from the current logged in user and for this, I understand, I need to use the MembershipUser, Membership and MembershipUserCollection classes. When I instantiate the MembershipUserCollection class and traverse the users, all works fine, but as soon as I try to create an object from the currently logged in users, I get an error noting "method or object not implemented". Here is my code: MembershipUser user = Membership.GetUser(strCurrentIdentity);  <!-- Exception on this line. strCurrentUser = user.UserName; ps.  Let's assume I have trim the "strCurrentIdentity" down to only have the username portion in it.  http://technicallead.wordpress.com/

Cannot view website designed in MOSS 2007 using FireFox browser


Our website www.cradleofhumankind.co.za cannot be viewed properly by those using FireFox browser. it appears that not all the content on the site is downloaded. What can be done about this. The website was designed using MOSS 2007.

Please advise of possible solutions.

How to override Membership.GetUser() ?


hi , i have add a new column (CustomeAuth) to aspnet_Users but i need to get the value of this column just like:


so i can use :


Thanks and regards,


error with Membership.GetUser(NewUserWizard.UserName)


on the third line of code I get message that "NewUserWizard" is not declared.  How can I remedy this?

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
        ' Get the UserId of the just-added user
        Dim newUser As MembershipUser = Membership.GetUser(NewUserWizard.UserName)
        Dim newUserId As Guid = CType(newUser.ProviderUserKey, Guid)

        ' Insert a new record into UserProfiles
        Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString()
        Dim insertSql As String = "INSERT INTO UserProfiles(UserId, HomeTown, HomepageUrl," & _
            "Signature) VALUES(@UserId, @HomeTown, @HomepageUrl, @Signature)"

        Using myConnection As New SqlConnection(connectionString)
            Dim myCommand As New SqlCommand(insertSql, myConnection)
            myCommand.Parameters.AddWithValue("@UserId", newUserId)
            myCommand.Parameters.AddWithValue("@HomeTown", DBNull.Value)

            myCommand.Parameters.AddWithValue("@HomepageUrl", DBNull.Value)
            myCommand.Parameters.AddWithValue("@Signature", DBNull.Value)

Firefox Version Wrong with Request.Browser.Version



I'm try to get my site to detect what browser someone is using to ensure they're using one that is compliant with our site. Everything works, except Firefox seems to post the wrong version in the Request.Browser variables.

I'm on Firefox 3.6.10, but Request.Browser shows Mozilla It's correct in the HTTP_USER_AGENT string:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100914 YFF35 Firefox/3.6.10 ( .NET CLR 3.5.30729)

Is there a way to detect it better without having to parse through the HTTP_USER_AGENT string?



Cross browser audio playback on membership auth. site...


Using VS2005, VB code behind,

I have a page that contains the following object tag...

        <object id="mediaPlayer" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="0" height="0"> 
            <param name="url" value="" /> 
            <param name="animationatStart" value="false" /> 
            <param name="transparentatStart" value="true" /> 
            <param name="autoStart" value="true" /> 
            <param name="autoSize" value="false" /> 
            <param name="showControls" value="false" /> 
            <param name="volume" value="100" /> 
            <embed type="application/x-mplayer2" pluginspage="https://www.microsoft.com/Windows/MediaPlayer/" src="" 
                  name="mediaPlayer" autostart="true" autosize="false" showcontrols="false" volume

How refresh parent page from popup on Firefox & IE browser


I have used following codes and it will worked on IE but not in FireFox browser

1] <script langauge=""javascript"" type=""text/javascript"">window.opener.location=window.opener.location;</script>

2] window.opener.location.reload(true);

3] <script langauge=""javascript"" type=""text/javascript"">window.opener.location.href='../parentpage';</script>"

4] window.opener.location.reload(true);window.opener.location.href=window.opener.location;

Folder structure of pages are as like -

main folder (ABC) ---> sub folder 1(PQR) ---> parent page ( which needs to refresh )

                                 sub folder 1(PQR) ---> sub folder 2(XYZ) ----> popup page

From above structure, I need to refersh parent page which is in PQR folder from popup page which is in XYZ folder under PQR folder.

Please provide me javascript code which will work for both browser as IE and Firefox



Membership.GetUser().UserName On Login Page



I have an Employee class in my App_Code folder.  On my login page I am trying to create an Employee using the asp.net username as a parameter in my Employee constructor.

 I have tried creating the employee in the page load event when it is a post back.  I have tried doing it in the Login1_LoggedIn event.  For some reason I cannot pull the username in either one of these places, but if I redirect after logging in and do the same thing on another page, it works.

How can I get it done on the login page?


  Dim em As Employee

        em = New Employee(CInt(Membership.GetUser().UserName))


FormsAuthenticationTicket issues in firefox(multiple instance of browser)


Hi All,

I am using forms authentication in asp.net application. This is working fine in internet explorer. Opening application in firefox is also fine but when i login in second instance of firefox, application in first instance logs out. Following is my code for creating ticket and cookie.

FormsAuthenticationTicket objTicket = new FormsAuthenticationTicket(1, sUserName, DateTime.Now, DateTime.Now.AddMinutes(60), false, "");

HttpCookie objCookie = new

Prevent browser caching of web pages in asp.net which works in all browsers (IE/Firefox..)

The article Prevent browser caching of web pages in asp.net which works in all browsers (IE/Firefox..) was added by grizz on Thursday, October 28, 2010.

In this articleI am going to explain how to prevent the browser caching of web pages in asp.net. It is the one of the biggest issues every developer willface.Why browser caching? To speed up the user experience on the web, most browsers implement a technology

How to manage browser compatibility between IE and mozilla firefox


HI all,

I have developed one website which works very fine on IE 6,7,8 but i am not able to see my pages finely on mozilla firefox.

i have used

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

tag for IE Compatibility.

i want to run my website on mozilla firefox.

Please Help me

How to setup a Mobile Browser Emulator in Windows Mobile 6:

In the following tutorial, I cover the process of Setting up Windows Mobile 6 for Mobile Browser Emulation using the Microsoft Device Emulator. This enables a user to experience Windows Mobile 6 on a PC via Emulation without even owning a Windows Mobile 6 product. It can be a great way to test drive Windows Mobile 6 before purchasing a product with it installed. In our case, it allowed us to Emulate Windows Mobile Browsing so that we could optimize our sites for the Mobile viewing audience. Installation and Emulation is simple and fairly straight forward.

*.axd script references not being rendered to browser


I'm running VS2010 with .net 4.0, and am running into issues with the .net ajax script tags mysteriously not being rendered to the browser.

So far I've reduced it to a scenario where I set the DataSourceID property of a databound control.  More specifically, I've only tested it on a Gridview and a DropDownList.

This can be reproduced fairly easily on my machine by following these steps:

1. Create a new empty Web Application Project

2. Create a new Web Form

3. Add a ScriptManager inside the form

4. Add a DropDownList and a DataSource (I used an ObjectDataSource)

5. Set the DataSourceID property of the DropDownList to the ID of the DataSource.  This can be done either declaratively on the .aspx page, or in the code behind in the aspx.cs page, and both produce the same results.

6. Open the page in a browser and watch as you get a javascript error stating "Sys is not defined" and notice that the page source contains no script tags referencing *.axd scripts.

Here's my source code showing my set up:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ScriptResourceFAIL.Default" %>


WebDev.WebServer.exe has encounted a problem and needs to close when trying to view page in browser


Hi, whenever I load an aspx page in vwde2008, I get the message in the subject of this post.  After I click Ok on that, I get a dialog box, Unable to Connect to the ASP.Net development center.  What can I do to troubleshoot?

I am using Windows XP SP3, vwde2008 with SP1, on a HP desktop.  Also using Office 2003 if that is relevant at all.

Thanks, Justin

Multiple membership providers



In my web.config I have:

        <add name="ADProvider1"
        <add name="ADProvider2"

If I just have ADProvider1 it works, when I add ADProvider2, even though for testing I only use ADProvider1 I get an error: "Unable to establish secure connection with the server"

Am I adding the second provider to the membership section incorrectly?



Replacement options for Membership


Hi everyone,
     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenticated, while others properly show me as authenticated. I built a site based on VB.
I was wondering what other people are using ro register users and monitor authentication and also if anyone has had better experiences with other solutions. 

Hi everyone,

     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenti

Pass ASP.NET membership identity object across domain?


I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?

If this is possible, I am going to implement this solution. Please tell me what's your take on this.

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