Coloring A Map According To Mapped Database Values?
Jul 17, 2010
Coloring a map according to mapped database values?
Question: [URL]
one can see a map of european countries colored according to state debt/deficit. Now I would have already found it useful several times if I was able to do such a thing myself, for example to visualize regional sales data.
Is there any (OpenSource) tool with which I can color a world/continental/reginal map according to colors mapped to values in a database ? Or any tool that can construct a custom map ?
Or if there is no such thing, how would one do such a thing oneselfs ? Get the outlines of countries from somewhere, make everything outside the country outlines transparent, set the coordinates and z-indeces to stack several images over one another, and then replace the base color with the selected color in each image, then merge the result to a single picture ?
I have a situation where some dropdown listboxes contain some items, then there's a separator line, and then there are more items. The ones above the separator line reflect the "commonly used items". To better highlight these I was using code like this to individually color those specfic items:
foreach (ListItem item in ddList.Items) { if (item.Value == "-1") unAssigned = true; if (!unAssigned) item.Attributes.Add("style", "color:#5558ff"); }
This code works fine EXCEPT that once a PostBack occurs then the highlighting disappears. The items in the dropdown listbox remain (without repopulation) but not the highlighting.
I'm curious why this is happening and whether there's a way for the highlighting to "stick" short of calling this code from the Page_Load event handler every Postback?
Need to upload files in mapped drive. i tried with UNC path. locally i tried with 2 systems its working fine. but in production environment its not working. Scenario is, 2 systems with windows 2003 server. one is app server and second is data server. Hosted app in IIS. Its something with the drive/folder permissions.
I've been tasked to convert our old DAL that have gen objects to possibly the Entity Framework 4.0. We create objects inheriting from our genned objects and have a ton methods our legacy codes uses. Does anyone have an idea or possible solution on how to create an entity framework model that maps to our old genned objects? Or a solution that requires us to modify our legacy code minimally?
Is there no way to detect if the current request is being mapped via ASP.NET 4.0 URL routing?
I have an HTTP module that handles the application's BeginRequest event. I have found that this handler is called for all file types, including CSS, JS, image files, etc., and I just want to perform an action if the target file is an ASPX page.
In the case of routed pages, all the properties of the HttpRequest object reflect the requested URL, and not the ASPX page that the request is being mapped to. How can I determine if the request will be handled by an ASPX file?
I have file locations stored in my DB. The locations are mapped drives on a different server. How can I access them? Do I need to set something up in IIS?
Short Version: Can anyone say whether it's possible or not to use impersonation in ASP.NET to access mapped drives?
Long Version: I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined for the user account I'm impersonating.
For example, let's say a file lives on the network at "machinefolderfile.txt", and let's also say that drive S: is mapped to "machinefolder". We need to be able to access both the full UNC path, "machinefolderfile.txt", as well as the shorter, mapped drive path, "S:file.txt".
Obviously the standard ASP.NET process cannot access either.
Using a console application that runs under the local account with the mapped S: drive, calling File.Exists(@"machinefolderfile.txt") returns true, and File.Exists(@"S:file.txt") also returns true.
However, when impersonating in an ASP.NET context with the same local account, only File.Exists(@"machinefolderfile.txt") returns true. File.Exists(@"S:file.txt") returns false.
I'm testing with IIS 7 running on my local Windows 7 Professional box, though this will need to run in both IIS 6 and IIS 7.
Impersonation is handled with a couple of classes in C# which I'll include here:
public static class Impersonation { private static WindowsImpersonationContext context; public static void ImpersonateUser(string username, string password) { ImpersonateUser(".", username, password); } public static void ImpersonateUser(string domain, string username, string password) { StopImpersonating(); IntPtr userToken; var returnValue = ImpersonationImports.LogonUser(username, domain, password, ImpersonationImports.LOGON32_LOGON_INTERACTIVE, ImpersonationImports.LOGON32_PROVIDER_DEFAULT, out userToken); context = WindowsIdentity.Impersonate(userToken); } public static void StopImpersonating() { if (context != null) { context.Undo(); context = null; } } } public static class ImpersonationImports { public const int LOGON32_LOGON_INTERACTIVE = 2; public const int LOGON32_LOGON_NETWORK = 3; public const int LOGON32_LOGON_BATCH = 4; public const int LOGON32_LOGON_SERVICE = 5; public const int LOGON32_LOGON_UNLOCK = 7; public const int LOGON32_LOGON_NETWORK_CLEARTEXT = 8; public const int LOGON32_LOGON_NEW_CREDENTIALS = 9; public const int LOGON32_PROVIDER_DEFAULT = 0; [DllImport("advapi32.dll", SetLastError = true)] public static extern int LogonUser( string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, out IntPtr phToken ); [DllImport("advapi32.dll", SetLastError = true)] public static extern int ImpersonateLoggedOnUser( IntPtr hToken ); [DllImport("advapi32.dll", SetLastError = true)] public static extern int RevertToSelf(); [DllImport("kernel32.dll", SetLastError = true)] public static extern int CloseHandle(IntPtr hObject); }
Then, during Page_Load, we basically do something like this:
if (!File.Exists(@"S:file.txt")) throw new WeCannotContinueException();
I realize using mapped drives isn't a best practice, but for legacy reasons it's desirable for our business. Can anyone say whether it's possible or not to use impersonation in ASP.NET to access mapped drives?
I have a asp.net mvc project in VS2010. In it I have a view called main.aspx that contains alot of javascript that frequently needs to be debugged. I can set the break point in the aspx page's javascript at edit time in VS2010. It appears as a mapped breakpoint. When I launch the debugger/IE browser, the javascript break point never gets hit. If I add a debugger; statement to my javascript I can launch a new visual studio instance and debug javascript. Unforunately, this requires a second visual studio instance and I have to set breakpoints all over again when I do it this way. Also, I have to remember to remove the debugger; statement when I am finished debugging. Is there a better way to get client side breakpoints working in Visual Studio 2010/IE?
i have the following code. what i have tried to do is map a path which points to my R:/ - the value 'R:' is stored in my web.config file. this drive is on my server. what i then do is pass the file name and play in an embedded media player in the web browser. when browse the website everything works fine. however, when i browse the website on another PC, i get an error saying it cannot access the file. is this because the second PC i tried the wesbite on doesnt have an R: drive? i wouldnt have thought this was a problem though. is what i am doing wrong? does anyone know why i cant access the file on that drive?
I am facing a wired issue currently. I have created a application that runs on FileWatcher system. It works fine on the local folder but when I try to use it over a mapped network I am getting following error:
System : The directory name Z:Pratik TalatiDownloadssharedinput is invalid.
I have a table added to a dbml file in my website. The website is already deployed to Live server. Now I have been instructed to a add a new field to the table. The field will be defaulted as getdate().
I don't plan to modify my dbml file for this change since the filed holds a default value. Will it cause any issue(performance related or any other). I am sure that I will not have to use the newly added field in the website. I am new to LINQ.
I am trying to generate a Grid view from database, in one of my database columns the values are 'y' and 'N'. and i need to show this values in a check box .I tried to keep a check box in item template and tried to bind it, but could get much success.
We have a shared drive where web applications are published to. When I attempt to publish I get the following error:
------ Publish started: Project: XXX.Web, Configuration: Release Any CPU ------ Connecting to T:WebSitesXXX...
Unable to create the Web site 'T:WebSitesXXX'. The path 'T:WebSitesXXX' does not exist or you do not have access. The system cannot find the path specified.
Details
OS: Windows 7 IDE: Visual Studio 2008 (running as administrator) Path exists? Yup.
I assume it's some permissions issue, but I have no idea where to start.
When I have a HttpHandler class in C#/ASP.NET mapped to a file extension in IIS any file with that extension fails to download/display in web browsers (it's downloaded as a 0-byte file in some browsers and nothing at all in other browsers). After removing the application mapping for the HttpHandler in IIS so it doesn't call the IHttpHandler class in C#, the web browser downloads the file successfully.
This was tested with an IHttpHandler class in C# that has an empty ProcessRequest method.
I hope I can explain myself properly. What i'd like to do is be able to add a Search form where users can search various criteria based on my Orders table. I was hoping to add the capability to click on one of the OrderID's to display the fields from the Orders in the various text boxes on my form. This would allow the users to search, and update all in the same page. I have the data retrieval portion down pat, but am not really sure how to give them useful links. Is this possible? Or is there a better approach that I could take?
how to bind values in combobox from database in that combobox my first value should be display as <----select----->, but i have no such values in my database.