Web Forms :: Why Can't Use 'user.identity.name' In Masterpage Code Behind

Sep 5, 2010

I tried to use user.identity.name in a master page code behing but intellisense doesn't recognize it.

If I change Inherits masterpage to inherit page then intellisense accepts it. What's going On?

View 2 Replies


Similar Messages:

Security :: Passing The User.identity Object To Shared Code?

Dec 13, 2010

I have a shared module in an asp.net web app which gets various information about a group or user. Since the Iuser account on the web does not have enough rights to query the AD, I need to supply an appropriate userid and passcode for the directoryentry in the shared code. Since my credentials so the have the appropriate rights to query the AD I like to impersonate myself(user.identity). This works fine for a webpage, but I can't pass the user.identity object to shared code. I get an error. Is there a way to pass the user.identity object to a shared function in another module?

View 1 Replies

Inject Code Into Masterpage / Html Head From A User Control?

Jan 10, 2010

I am struggling with something that I guess should be standard practice really. I have a number of user controls that use some JQuery plugins. I do not really want to link to the extra CSS and JS files from my main masterpage as this would cause extra load to the user the first time they hit the site, (admittedly it would only be the once), so I was just putting them links into the top of the user control. Then I looked at my source HTML, not nice! Even worse for controls that repeat multiple times on a page.

So I was thinking is there a way of injecting them into the Head of the page when they are needed from the User Control. For that matter is there a way of doing it to the footer for JS stuff?

View 4 Replies

Which One Should Use For "anonymous User Identity" - "specific User: IUSR" Or "application Pool Identity"?

Feb 2, 2011

In IIS Manager center pane, there is an icon titled "Authentication" as follows: Clicking the icon, we get 3 items as follows: Right clicking the Anonymous Authentication and select edit, we have: Question: which one should I use? What is the difference?

View 3 Replies

Web Forms :: Add User.identity.name Into Db Through Sqldatasource In Vb?

Mar 3, 2010

how do i add user.identity.name into db through sqldatasource in vb?

View 16 Replies

Security :: Using Page.User.Identity.Name To Fetch User Information From A MsSQL Database?

Dec 23, 2010

I have implemented Forms authentication in an ASP.NET MVC 2 website

By using <%: Page.User.Identity.Name %> on the Site.Master page I can display the userid of the logged in user.

I would like to use this value and display other information about the user that is stored in a User table in a MsSQL database, like:

<%: GetFirstname(Page.User.Identity.Name) %>

View 2 Replies

Method Is Only Supported If The User Name Parameter Matches The User Name In The Current Windows Identity?

Jan 30, 2011

get the below error. My application was working fine until I probably modified something, but don't know what.

Server Error in '/' Application.

Method is only supported if the user name parameter matches the user name in the current Windows Identity.

Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.Provider.ProviderException: Method is only supported if the user name parameter matches the user name in the current Windows Identity.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ProviderException: Method is only supported if the user name parameter matches the user name in the current Windows Identity.]
System.Web.Security.WindowsTokenRoleProvider.GetCurrentWindowsIdentityAndCheckName(String userName) +2195661
System.Web.Security.WindowsTokenRoleProvider.GetCurrentTokenAndCheckName(String userName) +36
System.Web.Security.WindowsTokenRoleProvider.GetRolesForUser(String username) +61
System.Web.Security.RolePrincipal.IsInRole(String role) +182....

View 1 Replies

DataSource Controls :: Use Dataset To Display Sum Where User= User.identity.name(not Use Gridvew, Or Formview)?

Oct 27, 2010

i want to use dataset , or any thing ... to display Sum * where user= user.identity.name(not use gridvew, or formview) because i have more then 100 columns . i m newbie. realy , 1 month, it not solve, sometime , i want to give up

View 3 Replies

AJAX :: HTTPCONTEXT.USER.IDENTITY.USER Return As String In WCF Returns No Value?

Mar 2, 2010

I have created a web services (WCF) and i have a webmethod that return a string that string is a HTTPCONTEXT.USER.IDENTITY.USER unfortunately it does not return any value.

View 9 Replies

User Identity Name Showing Windows User Instead Of Network Service?

Jun 28, 2011

In the IIS, it shows that the web app (i'm using) is using an application pool that uses NETWORK SERVICE account for identity. But when I debug/run my web app, User.Identity.Name shows that my windows user login instead. I checked my web.config file, and it does not have Impersonate enabled. In fact, I set it to false, and it still shows the same.

View 1 Replies

Web Forms :: Get Currently Login Windows User Identity In Application

Jan 4, 2011

I have this web application where I need the currently logged in windows user Identity. I server on which I deployed this application does not support virtual directories. And I am not sure if that server is configured for "Integrated Windows Authentication."

I tried using:
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Request.ServerVariables["AUTH_USER"];
HttpContext.Current.User.Identity.Name;

All these work and retrieve the appropriate currently logged in windows username when the application isn't deployed. But when I deploy it on this particular server, these methods do not give me nothing.

View 4 Replies

Web Forms :: Accessing User Identity From Master Page?

Jan 23, 2010

When I use a Master Page with a Content Page, in the Content Page script I find that User object is defined, with Identity and IsInRole properties. However, when I enter script on the Master Page itself User comes up as "not declared".

I am guessing that User is embedded in some namespace that is automatically imported to Content pages, but haven't been able to track it down.

View 1 Replies

MVC :: Forms Authentication User.Identity.IsAuthenticated And Cookie?

Feb 9, 2010

I am using forms authentication and have an issue with a particular browser using the remember me feature. For various reasons I want to support the opera browser that works with the nintendo dsi. I can use forms authentication with that browser just fine but when I use the remember me (cookie) feature I can get through the login but then calls to User.Identity.IsAuthenticated return false. If I do not check remember me it works fine. Initially I thought the browser didn't support cookies but it does. At least I can go to m.gmail.com and check their version of remember me and it works. I can exit the browser and come back in and m.gmail.com remembers me. Also I don't have problems with remember me on any other browser I have tried.

Is anyone aware of some specific browser issue that doesn't work with asp.net forms authentication? I am using asp.net mvc but I doubt that matters.

View 3 Replies

Security :: Isolating The User Name In Page.User.Identity.Name?

Mar 4, 2010

Is there a simple way to just retrieve the user's name, and not the Domain name, when using this function:

string quizTaker = Page.User.Identity.Name.ToString();

Right now it returns "DOMAIN_NAMEUserName"

I would like to just use isolate and use the user's name, without the Domain name.

View 2 Replies

MVC :: How To Retrieve User.Identity.Name From View User Control

Jun 9, 2010

i currently work on an asp.net mvc 2 project and noticed that inside an asp.net mvc view page i can get the user name authenticated via User.Identity.Name, but if i try to use the DsiplayFor method in order to display my model from a view user control, it just does not exist. Could i pass this parameter to my model using additional ViewData parameter that comes with DisplayFor html extension?

View 2 Replies

Web Forms :: How To Write Code With A Masterpage

Jan 10, 2010

How can I write this with a masterpage

View 2 Replies

Security :: Forms Authentication Cookie Not Changing Current User Identity

Jan 21, 2010

I am having a problem with security in a web application I am building using Visual Web Developer 2008. I am using Forms Authentication:

<authentication mode="Forms">
<forms name=".MYAUTH" timeout="20" enableCrossAppRedirects="true" />
</authentication>

And a SQL Server database with ASP.NET Membership and Roles. I am using the LoginView control with the AnonymousTemplate and LoggedInTemplate to manage the user's interaction with logging in and out. The problem I am having is that I am authenticating the user against the database:

If Membership.ValidateUser(_userName, _txtLoginPass.Text)
Then returns True and:
FormsAuthentication.SetAuthCookie(_userName, False)
sets the cookie correctly:
FormsAuthentication.Decrypt(FormsAuthentication.GetAuthCookie(_userName, False).Values(0))
{System.Web.Security.FormsAuthenticationTicket} CookiePath: "/"
Expiration: #1/21/2010 1:42:27 PM#
Expired: False
IsPersistent: False
IssueDate: #1/21/2010 1:22:27 PM#
Name: "jaymo "
UserData: ""
Version: 2
but when I check
HttpContext.Current.User.Identity.IsAuthenticated it always returns False.
If done this before and it worked fine. I cannot find any mistake I might have made or where something might have changed between ASP.NET 2.0 and 3.5.

View 2 Replies

Web Forms :: Sequence Order For Page.IsPostBack And User.Identity.IsAuthenticated?

Apr 22, 2010

What is the best sequence order for Page.IsPostBack and User.Identity.IsAuthenticated? From what I have search for, this comes up most common:

If Not Page.IsPostBack Then
If User.Identity.IsAuthenticated Then
~Some kind of code~
End If
End If

Is this considered "best practice" or can the two items - Page.IsPostBack and User.Identity.IsAuthenticated -be split into their own sections so the fuctions of these can be independent of each other?I am trying to troubleshoot a placeholder that disappears from a master page when a content page button is pressed to change the content pages active view (I have a multiview w/ 5 views inside of it).

View 2 Replies

Forms Data Controls :: Sum Where Userid = User.identity And Send To Label?

Feb 23, 2011

i have 10 columns, diffrence user insert (rows)many time, i want to display in page lick this :select Sum where userid=user.identity datetime =date.now and send sum of each columm to 10 labels on page.

View 4 Replies

Web Forms :: MasterPage Pop Up / Optimize That Resizing Code For Asp?

Nov 2, 2010

I have a master page(created for pop ups as i have a lot..) with the following code:

<body>
<div id = "weadas>
content content content..
<div>
<script type="text/javascript">
var content = document.getElementById("weadas");
window.resizeTo(content.offsetWidth + 50, content.offsetHeight + 50);
</script>
</body>

Wich i call with the following linkbutton:

lbnDictionary.Attributes.Add
(
"onclick",
"window.open('../ijSistema/ijPopUp/ppUpDictionary.aspx','mywindow','width=auto,height=auto,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no'); return false;"

but then it does not resize properly when poping up. It does work in IE6 but it does not in IE8 nor Mozilla 3.0.

Any ideas of how to optimize that resizing code for asp.net?

View 2 Replies

Forms Data Controls :: Filter On User.Identity.Name - FormView Disappearing From The Web Page?

Oct 21, 2010

I have a FormView and the SELECT statement I have is as follows:

SelectCommand="SELECT [UserName], [Full_Name_1], [Full_Name_2], [Email], [Address], [City], [State], [Zip_Code], [Home_Phone], [Cell_Phone] FROM [Homeowners] WHERE ([UserName]='<%$ User.Identity.Name %>')"... but it results in the FormView disappearing from the web page. Note: at the top of the page,
<%= user.identity.name %> displays the name fine, so user.identity.name does contain the info I'm looking for.I am trying to figure out how to correctly format the SELECT filter to feed user.identity.name to the SELECT statement as a filter. ... or if there is an alternative way.

View 4 Replies

Web Forms :: Inserting Code Into Masterpage Tag From Child Page?

Feb 14, 2011

I have a some javascript code that I only want to run in one child page but it needs to be in the head tag to function correctly.

<script type='text/javascript' src=[URL] ></script>
<script type='text/javascript' src=[URL]></script>
<script type='text/javascript' src='lightview/lightview.js'></script>
<link rel="stylesheet" type="text/css" href="lightview/lightview.css" />
end code

Can anyone tell me how to do this? I cannot put it straight into the master page as it conflict with some other javascript code that I am running on a different page! And I cannot put it into the body of the child page because it does not function correctly.

View 4 Replies

Web Forms :: How To Put User Control Into MasterPage

Jul 18, 2010

i have user control (Menu) that page in it are Dynamic when i put it into the master page the menu not appear ?? how can i put user control into MasterPage

View 7 Replies

Web Forms :: Can Show The Code To Put In A Masterpage So That When Expand A Child Node

Oct 20, 2010

I created a sitemap with a treeview navigation in my aspx site. I am hoping someone can show me the code to put in a Masterpage so that when I expand a child node, all other nodes collapse, and when I expand another node, the previous expanded node collapses.

I have an example here of what I am trying to accomplish:

[URL]

I am using asp.net with VB.

View 6 Replies

Web Forms :: Accessing Masterpage From Web User Control?

Aug 3, 2010

I am currently working on an application implementing custom localization features. I have created a number of web user controls for different activities on user designed pages. I wish make my webcontrols to check if the page using the control is a simple page or content page of a master page. In case of simple page we need to change page direction from ltl to rtl. In case of content page we need to change direction of master page.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved