I'm trying to capture the username (and domain) of the user accessing the web application (web server on the same domain for starters). I have modifed the IIS settings to use Windows authentication and added stuff to web.config and use the following code below to capture this information - and it works as long as the web server is the localhost i.e it works only if the web app is accessed via a browser on the web server. Otherwise it returns a null string, what do I need to do? (currently buidling on .NET 2.0) Snippet of code in VB.NET (objGenericIdentity.Name contains null string when web app is accessed outside of web server): Dim formsAuthTicket As FormsAuthenticationTicket Dim httpCook As HttpCookie Dim objGenericIdentity As GenericIdentity Dim objMyAppPrincipal As securityPrincipal Dim strRoles As String() httpCook = Context.Request.Cookies.Get("authCookie") formsAuthTicket = FormsAuthentication.Decrypt(httpCook.Value) objGenericIdentity = New GenericIdentity(formsAuthTicket.Name) strRoles = formsAuthTicket.UserData.Split("|") objMyAppPrincipal = New securityPrincipal(objGenericIdentity, strRoles) HttpContext.Current.User = objMyAppPrincipal web.config contains this: authentication mode="Windows" identity impersonate="true" (I'm not using anything related to formsauthentication in the web.config file, do I need to?). And finally, what would I need to do to get this info when web app is accessed from a different domain? arvind
anarayan
Posts
-
null string returned for domain and username (Windows auth) -
disable default behavior of backspaceI'm using VB.NET for a web application. How can I disable the default behavior of the backspace button of going back to the previous page on the browser? I still want to use it inside certain controls to delete the previous character entered (I know how to get this to work using onkeydown) arvind
-
dropdown item access thro' JavascriptI have a web control which is a dropdown list box (created & populated in VB.NET) - I want to be able to manipulate the selected value of this dropdown box based on text entered elsewhere (in another control - a textbox). For this I'd like to use the onkeyup or onkeypress methods and trigger a Javascript function which will select a particular value in the dropdown box. My dropdown box is not a typical HTML options box, but it's a VB dropdown web control. Such being the case how do I do this in Javascript? I found some code elsewhere (which I'm listing below) but this will not apply (I think) in my case - do I use some other getElement* method to get to the first item populated in the dropdown box? function searchDropdown(searchStr,ddObj) { var index = ddObj.getElementsByTagName("option"); for(var i = 0; i < index.length; i++) { if(index[i].firstChild.nodeValue.toLowerCase().substring(0,searchStr.length) == searchStr.toLowerCase()) { index[i].selected = true; break; } } }
-
Dropdown clickYou have to add a handler to trigger the event: (code below is in VB) AddHandler CType(FindControl("YourDropDrown), DropDownList).SelectedIndexChanged, AddressOf TakeAction "YourDropDown" is the ID of your dropdown box and "TakeAction" will be an event procedure that you have to do whatever you need to do when the index changes.
-
type ahead in dropdown listIs there a way to capture type ahead in a dropdownlist (ASP.NET/VB.NET application) - i.e if a user types more than one character quickly I want to select an item in the list that starts with the characters typed, not jump to the item that starts with the last character typed. For example if the dropdown list has 3 items MINNESOTA, MISSISSIPPI, MAINE, MARYLAND, MASSACHUSETTS, typing "MAS" quickly should take me to item MASSACHUSETTS
-
Dropdown clickUse selectedindex_changed event
-
dll from asp.net web applicationI could not find aspnet_iis on the web server - I found aspnet_regiis.exe and looked at the options, not sure if this is what I should use to register aspnet_iis (but I can't find aspnet_iis). I'm not familiar with aspnet_regiis. Any pointers regarding this will be appreciated. To answer your question, I don't think it's an application issue because I don't use application variables at all (no static either). Thanks for your help. arvind
-
dll from asp.net web applicationThanks for your response. No static members or Application variables either. When I mean some data is available to other users I mean entire form controls pop up on a different browser actually meant for the one who initiated a page. So when two users on two different computers run the application it almost seems like the web server loses track of who made the request and sends part (or all) of the message to a different user who's also still in the application. Which is why I was wondering if the DLL has to be built or installed a particular way? All I do is to build the solution from within ASP.NET. arvind
-
dll from asp.net web applicationI have an ASP.NET application developed using VB.NET - creates a single DLL and a bunch of aspx, ascx pages (I don't register anything on the web server). When multipler users are connected to the application using this web server, they randomly see each other's data because threading doesn't seem to work correctly. In other words the web server returns the message packet to the wrong browser. In many cases the browser is painted with invalid information (all mixed up from various other user requests). I suspect this the case because I need to config/set up the DLL in some manner on the web server so that it's shared appropriately creating a separate data instance for every request thread coming in. (Or do I have to something in my code or while building the dll