|
I know this could be done better if I was using arrays, but currently I'm trying not to re-write too much code that currently exists. Is it possible to create a string that holds the variable name then uses that string to reference the variable in a parse. Here's the idea, I just don't know how to implement it correct if it's even possible. code:
code:
|
# ? Aug 15, 2007 16:05 |
|
|
# ? Jun 2, 2024 11:40 |
|
Is there any way to process a WebResponse's headers for HTTP headers, without making use of HttpWebRequest/Response objects? Alternatively, is there any way to still use a HttpWebResponse object, even though the response isn't valid HTTP? As far as I can see it immediately throws up a ProtocolViolationException and closes the connection. Basically I want all the advantages of using a HttpWebRequest/Response, while still being able to make use of it if the response isn't valid HTTP.
|
# ? Aug 15, 2007 17:48 |
|
Mecha posted:Is there some voodoo to handling drag-n-drop that I'm not seeing? I've tried setting virtually every control in my main form(and even the form itself for grins) to allow drops, and tried handling _DragEnter and _DragDrop in several controls, but none of them ever change the cursor nor allow the drop. I've looked through several tutorials which all say that this should be all you need, but for some reason it won't work at all. Here's the basic outline for the code I created to do drag-drop to a listview. Obviously, you have to set allowdrop for the listview for this code to work. code:
code:
I also have some crap in DragOver for the receiving listview to highlight the current item you're hovering over, but that's left for an exercise for the reader, haha. Anyhow, mostly I post this because it took me ages to figure out the mechanics of drag/drop too. I don't know why, but none of the online tutorials seemed straightforward enough to really pick up the required code. Or maybe I'm just slow.
|
# ? Aug 15, 2007 19:10 |
|
Fastbreak posted:Awesome, thanks for giving me direction. You wouldn't happen to want to just toss me the function you wrote to get all that would you and save a brother a whole bunch of time? Inquisitus posted:Well there is more than one static method used to get the windows (and many imported functions). They're all in a single file along with a load of other stuff that my app uses to capture screenshots. Inquisitus fucked around with this message at 19:37 on Aug 15, 2007 |
# ? Aug 15, 2007 19:29 |
|
genki posted:Anyhow, mostly I post this because it took me ages to figure out the mechanics of drag/drop too. I don't know why, but none of the online tutorials seemed straightforward enough to really pick up the required code. Or maybe I'm just slow. Actually, I figured it out last night--defining your event handlers in the Events tab will help with actually firing the events off. Of course, now I'm struggling with actually getting the app to run on the client's machine.
|
# ? Aug 16, 2007 08:51 |
|
I have several gridviews (asp.net) where I need to be able to hide the column with the "delete" button, depending on who is using the app. Right now I'm using this code: this.gridview.Columns[3].Visible = true; I'm really bothered by having to use the column number, it's bound to cause problems down the line when someone adds a column somewhere and suddenly a whole bunch of users can now push the delete button. (I'm probably going to intercept the delete event and do an explicit check to avoid un-authorized deletes, but I still don't like it.) Is there a way to indicate the column to hide with its name or something ?
|
# ? Aug 16, 2007 14:14 |
|
Judging from MSDN there does not exist an easy way to do that.
|
# ? Aug 16, 2007 14:37 |
|
Digital Disease posted:This idea is simply to go through the list of Text fields and grab the data and add it up together, I'm trying to avoid having to do this for each day of the week. code:
code:
|
# ? Aug 16, 2007 15:08 |
|
thestoreroom posted:You can do it via Reflection in something like this (untested rough code ahead!): Awesome, thanks! Now to do more reading on reflections. It really does help to have the correct terms to search for.
|
# ? Aug 16, 2007 15:15 |
|
Reflection is very, very expensive. Have you considered making it a template column and databinding the enabled property of the button based on your business logic? This way it can travel with the button rather than having to worry about column order dependency.
|
# ? Aug 16, 2007 16:28 |
|
wwb posted:Reflection is very, very expensive.
|
# ? Aug 16, 2007 18:23 |
|
Is there any way of filling a PropertyGrid with your own properties/values defined at run time? (As opposed to giving it an object and letting it enumerate all of its properties.)
|
# ? Aug 17, 2007 09:05 |
|
Inquisitus posted:Is there any way of filling a PropertyGrid with your own properties/values defined at run time? (As opposed to giving it an object and letting it enumerate all of its properties.) Something like this perhaps?
|
# ? Aug 17, 2007 11:48 |
|
Ran into a bit if a mystery today, wonder if anyone here has seen it. I am trying to connect one of our old (.NET 1.1) web applications to our newer (.NET 2.0) CRM system's web services. Should be simple--just setup the proxy and go--right? Well, no, it is not. For some reason, .NET 1.1's proxy generation creates a valid proxy, but it has two big issues: 1) It ignores changes to the Dynamic Url property. When I change the proxy to be dynamic, according to visual studio, the generated class keeps the hardcoded url. I suspect this is more a symptom of VS2003 making GBS threads itself. 2) When I send a request out on the proxy, it does not carry any data--the payload is null by the time the service gets to deserialize things. I am absolutely certain that the payload is not null when the proxy is invoked. I suspect the issue has something to do with the nature of the service, which is a class that implements two separate interfaces and comes up with two separate service classes. Anyhow, anyone see anything like this or have any ideas why this is blowing up?
|
# ? Aug 17, 2007 16:48 |
|
SLOSifl posted:I have an entire program that's basically built using reflection. It performs very well. Reflection *is* expensive, yes, but unless you're talking about using a lot of it in a tight, time-critical loop, there's probably not much reason to worry. It's also extremely powerful, and can make some seemingly complex things very intuitive, especially when combined with meta-data like attributes or backing databases/metabases. I probably overstated my one-liner a bit. That said, I think that it is not a good solution for this scenario mainly because it is so far beyond the typical asp.net web application pale that the poor souls maintaining this would have more trouble handling that code than dealing with a hardcoded column name.
|
# ? Aug 17, 2007 16:53 |
|
Has anyone found an autocomplete textbox or dropdown control for ASP .NET which can use SQL as a datasource, but which doesn't need to use a webservice? Or is it beneficial to use a webservice to handle the asynchronous requests from the textbox? My first impression is that having the webservice is both extra overhead and extra code to have to manage; why not just wrap the database code into the code-behind of the .aspx page?
|
# ? Aug 17, 2007 20:26 |
|
Well, the issue is that you need to expose that SQL over http, and most of the boxed controls use a web service because it is the easiest way to factor out external http requests in .NET and that is the way AJAX.NET wants to work. Insofar as extra code goes, I would argue that the logic behind the lookup should be encapsulated in your object layer rather than floating loose in the web service, so the only extra maintenence is creating the web service to wrap the method. Finally, I *think* you can skip having a separate service by using Ajax PageMethods rather than a separate ASMX.
|
# ? Aug 17, 2007 21:59 |
|
Darth Continent posted:Has anyone found an autocomplete textbox or dropdown control for ASP .NET which can use SQL as a datasource, but which doesn't need to use a webservice? Look into SQL Endpoints. They are literally webservices hosted in SQL Server. edit: They can be a little tricky to set up initially, since the syntax is a bit weird, but you can basically say "host this stored procedure as a webservice called whatever" and that's it.
|
# ? Aug 17, 2007 23:22 |
|
Thanks for the info.
|
# ? Aug 18, 2007 04:09 |
|
I'm kind of having a difficult time understanding DLINQ queries. Not so much the queries themselves but how they pull from the database. I also want to get people's opinion on "LINQ to SQL" on how good it is or scalable it is. Suppose that I have two tables, tblStore, tblApple. There's a foreign key to tblStore in tblApple (one store has many apples). Now I discovered that when I set up a LINQ to SQL, it will create an object back to the parent table. My question: code:
|
# ? Aug 18, 2007 17:20 |
|
I'm trying to find a way in ASP.NET to use Windows Authentication AND the Active Directory membership provider together. Windows Authentication provides the username in a format "DOMAIN\username", but the membership provider doesn't seem to like this -- if I try to lookup a user I have to do something like Membership.GetAllUsers()["username@domainname.com"]. Has anyone tried to do something like this? I really need the membership provider to be able to get email addresses and stuff, but really don't want to have to do forms authentication.
|
# ? Aug 21, 2007 14:55 |
|
For an ASP.NET app, I have the session start event retrieve user information, assign permissions to a User object, and store it in the session state. To check what permissions someone should have, there are several Active Directory groups someone could be in. So I query the AD, and put the groups the user is a member of in a collection. Then, I need to check if the user is in group A and assign according permissions, check for group B and assign permissions, and so on. The question is: what kind of collection do I put the groups in ? A StringCollection seems obvious, but is that fast enough ? Wouldn't a hashtable or something be better ? Or am I worrying too much again about irrelevant issues that aren't issues at all ?
|
# ? Aug 21, 2007 17:02 |
|
Probably worrying too much unless you have thousands of groups to check. I would, however, look at making your user object implement IPrincipal and push said user into the Context.User property. That way you can rely on .NET's builtin security features to handle stuff. Such as using PrincipalPermissionAttribute on methods.
|
# ? Aug 21, 2007 17:40 |
|
I know this isn't a coding question, but it still seems on topic. Can anyone recommend an affordable web host for ASP.NET 2? Dreamhost doesn't support it, goddady.com does, but I've heard bad things about their hosting. I am looking for something affordable, as my primary use will be a personal website to promote my photography.
|
# ? Aug 21, 2007 18:51 |
|
This is a really stupid .NET question, but google can't seem to help me. I'd like to add a warning to one of my methods so I know it's depcreciated so when I build it on older projects I'll remember that the method is older. I still want to be able to build them, so it has to be a warning and I'd like it to appear in the usual debugging place. Does anyone know how to throw your own warning message?
|
# ? Aug 21, 2007 19:22 |
|
fez2 posted:This is a really stupid .NET question, but google can't seem to help me. First, the spelling is "deprecated" which might help Second, you want the Obsolete attribute. edit: Don't feel bad about the spelling, I pronounced "deprecated" "depreciated" (as in 'fell in value') for a long time and was very confused when someone pointed out the error
|
# ? Aug 21, 2007 19:41 |
|
ahawks posted:I know this isn't a coding question, but it still seems on topic. I use http://ultimahosts.net/ and they seem pretty good so far.
|
# ? Aug 21, 2007 21:20 |
|
I have a gridview with a template column wiht nothing but Textboxs. In the textboxs, the user will enter a dollar amount that they want to pay for each line item. I have a javascript function in place to calculate the sum, but I was hoping to update the footer of the column to ensure proper alignment no matter what the value. Is there a way to access the footer field client side? If not, is there a better solution?
|
# ? Aug 21, 2007 21:46 |
|
fez2 posted:This is a really stupid .NET question, but google can't seem to help me. like this? code:
|
# ? Aug 21, 2007 21:57 |
|
wwb posted:Probably worrying too much unless you have thousands of groups to check. Ok thanks. I've had a quick look at IPrincipal and Context.User but it doesn't seem too useful for what I'm doing, the security checks are too complicated. Also the project is supposed to be finished at the end of next week so I don't really feel like changing it now. Made me realize (again) that there's still loads of things I don't know about asp.net though. Maybe I should take some overview course somewhere instead of just using google for everything ever.
|
# ? Aug 21, 2007 22:17 |
|
Fiend posted:like this? code:
|
# ? Aug 22, 2007 02:55 |
|
JediGandalf posted:No he's talking about more of something like this
|
# ? Aug 22, 2007 18:04 |
|
Oooh, another arcane issue: System.IO.Path.GetTempPath() in ASP.NET returns "C:\Documents and Settings\MyMachine\ASPNET\Local Settings\Temp\" on my system. But on my tester's system, it returns "C:\Documents and Settings\HisMachine\ASPNET\LOCALS~1\Temp\". Both of us are running XP SP2. Why is it using a short filename for the "Local Settings" portion (and ONLY that portion) of his temp path? Is there some way to force a full filename? Unfortunately, a third-party component doesn't seem to like the short file names. Dromio fucked around with this message at 21:53 on Aug 22, 2007 |
# ? Aug 22, 2007 21:37 |
|
Dromio: Check the system-level TEMP (or TMP) environment variable and see what it is on the tester's system - it might be set with the awkward LOCALS~1 path rather than the long form. Apparantly GetTempPath() isn't particularly clever and just returns the TEMP environment variable for the user it's running as.
|
# ? Aug 23, 2007 09:43 |
|
Anyone have experience with using COM and Interop DLLs? I've got a project reference to the Photoshop CS2 library(reported as "Photoshop 9.0 Object Library") to use its C# scripting interface, and it builds an Interop DLL that works fine with CS2 installations but apparently doesn't seem to recognize CS installations. The scripting interface didn't seem to change between the two, so I'm wondering if I need to take a more general approach towards getting a COM interface to the scripting system?
|
# ? Aug 23, 2007 10:23 |
|
Not really a COM guy, but I did my fair share of office VBA. Anyhow, this issue you are probably having is that Photoshop CS exposes Photoshop 8.0, not 9.0. Now, if the functionality is common, you could probably put this behind some sort of facade which wrapped the interface you are using and leave mapping to the right DLL to said facade.
|
# ? Aug 23, 2007 13:19 |
|
thestoreroom posted:Dromio: Check the system-level TEMP (or TMP) environment variable and see what it is on the tester's system - it might be set with the awkward LOCALS~1 path rather than the long form. Apparantly GetTempPath() isn't particularly clever and just returns the TEMP environment variable for the user it's running as.
|
# ? Aug 23, 2007 13:52 |
|
Dromio posted:Is there some way to force a full filename? code:
|
# ? Aug 23, 2007 15:11 |
|
I'm running Vista 64-bit and my code doesn't seem to be reading from machine.config. There are some appSettings elements in there, but when code tries to read them via ConfigurationManager.AppSettings["name"], they come up null. Does anyone know of some steps I can try to figure out what's going on? This same exact code works fine on XP, and a Vista 32-bit box that someone else here has. I'm pretty sure it's not a security or permissions issue, that's all I have so far. Edit: I just added the same key to the app.config and it still comes up null! WTF Edit2: machine.config belongs under c:\windows\microsoft\framework64 instead of c:\windows\microsoft\framework. I knew it was something dumb like that. Hey! fucked around with this message at 16:03 on Aug 23, 2007 |
# ? Aug 23, 2007 15:12 |
|
|
# ? Jun 2, 2024 11:40 |
|
When using the property grid is there a good "non hacky" way to organize the list. For example I have two main catgories -Communication -Misc -(more are coming) But I would like for Misc to be listed first, right now the best way (which we call the hack method) is by making the name <category( vbtab & "Misc")> Currently it the propertysort setting is set to Category (not the categoryAlphabetical) How can I go about changing the order of the categories?
|
# ? Aug 23, 2007 20:57 |