|
Edit: Nevermind, figured out how to use Eval properly. It will do.
Dr. Poz fucked around with this message at 00:38 on Apr 23, 2007 |
# ¿ Apr 23, 2007 00:13 |
|
|
# ¿ May 22, 2024 11:16 |
|
I'm trying to build a level editor tool using XNA and currently my Editor form has a fairly neutered Game object as a field. Today however, I found this approach (expanded on here). I really like the approach because it seems natural that the form would be a component of a "Game" in this case, and allows you to use any Game Components you have already developed seamlessly with your editor. However it has the big downside of the programmer having to either write winform code by hand, or copy it over from the "TemplateForm". This seems massively inefficient, and someone pointed out in the first comment that it was not necessary, but they didn't seem to expound on that much more. Can someone connect the dots for me on what the commenter might be trying to suggest?
|
# ¿ Jun 28, 2007 20:20 |
|
Reposting this here because it's probably more applicable than in the general web development thread. ASP.NET 2.0 - Membership/aspnetdb questions So if I muck about in the aspnetdb and change the values of the UserName and LoweredUserName fields my web app stops being able to properly pull info from the database during that sessions, but if I log in everything begins to work properly again. I know I'm really not supposed to be editing the values contained in this field but this is just me playing around so I'm curious as to if this is a solvable problem. Right now I simply have an override on the Login controls Authenticate method that uses the uses the users email address to grab the user name and authenticate the user instead of storing the email address as the actual user name. This allows me to change the login name whenever with impunity, so I was hoping to be able to use the user name as a kind of "display name" without having to create a table in aspnetdb. I have a few books on ASP.NET but none of them go deep on the database side of Membership. I'm not expecting an easy solution, but I always like to understand the problem better if anyone can provide details. At this point I'm thinking that the application can just log the user out but thats kind of sour.
|
# ¿ Dec 9, 2007 20:53 |
|
pliable posted:Okay that sounds good then. Fortunately for me, getting rid of the console I/O isn't a big issue, so hooray! Thanks. I'm not sure if it is quite what you are looking for but there is a program called XYNTService that will run a specified .exe as a service. link
|
# ¿ Jan 10, 2008 02:00 |
|
I have some controls that are status panels and they are programmatically added to my page. They are floated so that they can appear side by side. I wanted to put a border on the panel containing these controls but the floating throws that off, and since I cant put in a div declaratively for clearing, I created a custom control that is just a div used for clearing. It's really gimmicky but it works. My question is, am I stuck with this or is there a better way?
|
# ¿ Feb 2, 2008 05:57 |
|
Edit: So I woke up this morning and I was a lot less stupid somehow. This is how I have it written now. Is there anything I could do better?code:
I can do it by catching all of the responses in a List and sorting etc, but that would to be missing the point of the exercise. I'm still getting a hang of the different ways to select data, so different examples are welcome. Dr. Poz fucked around with this message at 16:51 on May 31, 2008 |
# ¿ May 31, 2008 04:05 |
|
Have you run/developed any ASP.NET stuff prior to this? If not, did you just install IIS? If so, was it installed after the .NET Framework? If so, did you run %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe? If not, do so.
|
# ¿ Jun 21, 2008 00:19 |
|
If it wasn't included in your SQL Server install package, download and install SQL Management Studio Express. This will give you a decent database browser/query tool. If you didn't name the instance of SQL server that you installed, when you run the Management Studio for the Server name put in (local) and for Authentication choose Windows Authentication. This will allow you to log into the database under your Windows account rather than having to use a username/password combination. You can configure it to allow remote connections but if its sole purpose is to serve data for web application run on the local machine then I would skip that entirely and recommend using Integrated Security for connecting to the database from your applications. An example connection string in your case might be: code:
code:
|
# ¿ Jun 21, 2008 07:19 |
|
I'm setting up a ClickOnce deployment site using Visual Studio 2008 and one of the prerequisites is SQL Server CE 3.5 w/SP1 but it doesn't appear in the list of prerequisite components from the Publish section of the main projects properties. I currently have it set to get the requisite software from the Vendors website. Am I going to have to host the components myself to be able to include this?
|
# ¿ Aug 20, 2008 14:37 |
|
Have you tried wrapping your "from" statement in parenthesis and calling .Single() on what is returned?
|
# ¿ Sep 10, 2008 17:26 |
|
uXs posted:In cases like this, I don't use the Linq query-like syntax, just the functions and the Lambda syntax: I would really recommend syntax like this and in fact was going to suggest it earlier but I didn't know what else you may have going on in your logic. Much cleaner and simpler. It's tough to get into the code:
|
# ¿ Sep 10, 2008 21:39 |
|
dwazegek posted:We're currently using an MS SQL database together with linq-to-sql. Now my department head has got it in his head that customers shouldn't have to install SQL Server Express along with our product in order to run everything. My company was faced with a similar dilemma when we saw what deployment would be like with SQL Express and we opted to use Sql Server CE on the client side, though we routinely make rash decisions for sake of expediency (and they routinely come back to bite us in the rear end...) so YMMV.
|
# ¿ Sep 11, 2008 17:12 |
|
I have a service that monitors a process on several servers and an ASP.NET web site that reports this information back. The service also has a RestartApp() method that the website can call to restart the monitored application. My problem is this: The monitored application runs under a local admin account and the service runs under NetworkService. I can supply the proper credentials to start the process, but I seem to be unable to kill the process because NetworkService doesn't have permissions to kill a process running under this local admin account. Is there a way to specify credentials to kill a process with? Is there a better service account to install the service under that would give me this ability? I have a way or two to work around this, but they are less than ideal.
Any ideas?
|
# ¿ Jan 7, 2009 20:40 |
|
CapnAndy posted:I'm learning master pages (which are awesome). I know how to make a content page access variables from the master page -- how do you do it in reverse? If at all possible, I want the master page to assume a variable exists in the Main contentplaceholder and read it. It'll save me having to have every single page setting that variable. Is there a reason you can't cache the variable in the session data instead?
|
# ¿ Jun 17, 2009 18:26 |
|
Free Bees posted:The only compatibility difference I know of is the use of custom user profile objects, specified in the web.config. Web Sites can take custom profile specifications in the web.config and compile them into a site-wide Profile class. Web Applications do not have this feature. This is true by default but you do have the ability to roll your own wrapper around the ProfileBase class or use WebProfileBuilder. It's not quite as easy to set up as the homepage makes it seem, but it's still drat easy.
|
# ¿ Sep 23, 2009 14:13 |
|
I'm using Visual Studio 2010 Beta 2 and whichever MVC preview is used by it. In my index view page I display a list of the users of the site with the names as links to a profile page. I also add an additional edit link next to the name of the current user browsing the page to allow the user to edit their profile. Obviously I want to restrict which profiles users can edit to only their own. I've used the Authorize attribute to restrict access on the basis of roles, but can it be used in this fashion also or do I just write the logic into the controller action and have it return a default view? Edit: I found a post on custom Authorization attributes. Would this be a use of them? http://davidhayden.com/blog/dave/archive/2009/04/09/CustomAuthorizationASPNETMVCFrameworkAuthorizeAttribute.aspx Dr. Poz fucked around with this message at 19:43 on Nov 2, 2009 |
# ¿ Nov 2, 2009 18:11 |
|
I'm using ASP.NET MVC in Visual Studio 2010 Beta 2 and I'm running into some strange behavior. In my master page, I link to a couple items in the head of the page like so:code:
code:
Dr. Poz fucked around with this message at 00:38 on Nov 13, 2009 |
# ¿ Nov 12, 2009 23:47 |
|
wwb posted:Excellent, this has worked out very well. Thanks!
|
# ¿ Nov 13, 2009 16:22 |
|
Does uninstalling Silverlight take the local storage with it?
|
# ¿ Nov 20, 2009 15:45 |
|
Is it bad form to use standard ASP.NET controls (such as the Menu control or something like it) in an ASP.NET MVC site?
|
# ¿ Dec 8, 2009 20:11 |
|
I've been doing a lot of reading lately and seen several mentions to LINQ 2 SQL being more or less unofficially dropped in favor of the Entity Framework. Is this something thats been brewing at Microsoft or is this just blog chatter? I read some comparisons of the two technologies and was kind of left wondering where LINQ 2 SQL would fit in.
|
# ¿ Dec 10, 2009 00:34 |
|
Silverlight question. I have a UserControl that looks like this:code:
code:
code:
|
# ¿ Jan 4, 2010 20:16 |
|
fankey posted:I think you're having the same issue the guy above was having. I haven't used Silverlight but the following would work in WPF The problem definitely bears similarities but I'm not quite sure they are the same. I am trying to bind the property and not a member variable so that isn't a concern. I don't think I can assign a x:Name to the UserControl declaration. To be clear, its a definition for a UserControl and not an instance of one, I just left out some of the details that would make that more clear for the sake of brevity. When I do so, it yields this error: code:
Dr. Poz fucked around with this message at 22:45 on Jan 4, 2010 |
# ¿ Jan 4, 2010 22:43 |
|
I've found some pretty nice stuff here http://icons.mysitemyway.com/ also.
|
# ¿ Jan 12, 2010 20:24 |
|
Triple Tech posted:Derp, I'm confused. If I make one project for my DLL that will have code reused, and then make N many applications that use it, how do I refer to that DLL in my code? How do I deploy the DLL? If you have the Project files, you can add the project to your solution and then in your application project, right click "References" > "Add Reference" and you can add the code library project. This will compile the project into a DLL and include it with your application. Otherwise, you can copy the your library DLL to any directory and add a reference to it in your application in the same way, just using the Browse tab of the Add Reference dialog instead of the Projects as you would in the other approach.
|
# ¿ Jan 19, 2010 23:17 |
|
Working with ASP.NET MVC and I'm running into an odd problem with server side validation. In the controller action that handles a form post, ModelState.IsValid is always returning true. Even when I input absolutely no data and every property of my model is marked with the Required attribute. The only thing that I can think is that my use of Ajax.BeginForm doesn't play nice with validation. Model code:
code:
code:
Dr. Poz fucked around with this message at 21:33 on Jan 21, 2010 |
# ¿ Jan 21, 2010 21:22 |
|
Fair enough. I'll side step the raging debate in the comments on that article, but this still leaves me with a quandry. I have (as seen in the model) a custom attribute called Email. It's a direct copy of one ScottGu posted in his blog. It's simply a regular expression that indicates whether or not something matches the pattern of an email address. I can input complete crap and ModelState.IsValid is true as always. Here is the EmailAttribute just to be sure my idiocy doesn't lay here. code:
|
# ¿ Jan 21, 2010 22:13 |
|
Begby posted:I would like to be able to have a collection who's key is bound to a specific item property, but make it so the key changes if the value of the property changes, like so. Can't you do this with LINQ to Collections .ToDictionary()?
|
# ¿ Feb 2, 2010 22:33 |
|
I've run into some strange behavior I hope someone can explain. I have a web application that has uses LINQ 2 SQL and one of my tables contains latitude and longitude. In an attempt to make things easier on myself, I wrote a partial class extension to add a property that returns the latitude and longitude as a Microsoft.Maps.MapControl.Location object. The Location property appears under the web apps Class View, however when a Silverlight project in the same solution receives the collection of objects from the web service, the Location property does not exist. This led me to look in the class view for the Silverlight project and the Location property does not appear there either. I've updated the service reference as well as removing it and readding the service but no dice. Why doesn't this property carry over? Edit: I solved it by just moving the partial class to the Silverlight project since I don't really need it in the web app project anyways. Still, I'm curious about why it doesn't carry over. Dr. Poz fucked around with this message at 20:57 on Feb 10, 2010 |
# ¿ Feb 10, 2010 20:04 |
|
I'm using ASP.NET MVC 2 on Windows 2008 with IIS 7. I have a controller action that returns a filestream so that an image can be handed out somewhat dynamically. It looks like this:code:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access to the path 'd:\sites\mysite\Content\img\bgs\file.jpg' is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access. In an attempt to fix this I've given most associated user accounts read permissions but nothing seemed to work. I've given ASPNET, Network Service, LocalSystem and IUSR read persmissions individually (never all at once) and still the error is thrown. How can I make sure the application has the permissions it needs? Dr. Poz fucked around with this message at 00:16 on Feb 23, 2010 |
# ¿ Feb 23, 2010 00:07 |
|
I've simultaneously given the following accounts read permissions to the directory containing the files I'm seeking to dish out:
and the app still yields the exception. I realize this is a matter of configuration at this point but everything sensible that I have tried doesn't work. Is there something I should have added into the web.Config to enable an operation like this?
|
# ¿ Feb 23, 2010 17:03 |
|
Sprawl posted:Well this may tie into how you authentic into your system. Your login system do you do anything with the default login tools like. There was a configuration change I made this morning that for the life of me I can't remember. After I made the change though and refreshed the URL it dumped me to my sites login page. I'm sure this has some relevancy as it indicates that the issue IS tied into how the site authenticates. I'll give this a run. How can I find out the local user its running as if it pans out? Sefyroth posted:This might be a shot in the dark and maybe just fake code, but are you sure your path is fine? Server.MapPath("~/Content/img/bgs/") might work, I don't know how it resolves /. The physical path that the error page gives me opens the file and works perfectly when I copy and paste it into a run prompt so I'm not so sure that's right. Free Bees posted:I had a weird permissions error returning files from an MVC app that was resolved magically by switching my app pool to the Classic pipeline. Doing this causes a 404...interesting.
|
# ¿ Feb 23, 2010 20:04 |
|
Sprawl posted:Well if you know how to "do" mvc you can add that into a sister or a copy of that application and run that instead of trying to open the files its best to do these things "live". The labels and the setting in the page load sub are the only important part. The 404 only occurs when I change the AppPool managed pipeline from Integrated to Classic. Otherwise the exception that gets thrown does produce the correct physical path to the file it complains about not being able to access. Server.MapPath is resolving to the correct location. Edit: This all works beautifully on my development machine, this problem only occured when it was deployed. Dr. Poz fucked around with this message at 20:34 on Feb 23, 2010 |
# ¿ Feb 23, 2010 20:28 |
|
I appreciate everyones insight. Thankfully it is now resolved per the instructions of this blog post: http://codezest.com/archive/2009/12/14/system.unauthorizedaccessexception-access-to-the-path-is-denied.aspx
|
# ¿ Feb 23, 2010 23:04 |
|
Is there really no info balloon/popup box in the Bing Maps Silverlight API? I've googled all to hell and I don't even see anything in the Pushpins about VisualStates.
|
# ¿ Mar 5, 2010 22:09 |
|
I have an IDictionary<string, int> and I'm trying to assign values from a LINQ2SQL data source. I tried to assign to it like this:code:
code:
code:
code:
|
# ¿ Mar 20, 2010 19:05 |
|
Having an issue in WPF. My application has two windows. One is for controlling a set of data and the other is for hosting a control to display the data. The problem is if the display form that contains the control isn't the Applications StartupUri, then the control doesn't render. I can place basic WPF controls (ex: textblock) on the form and they will appear just fine. Is there some kind of initialization I'm failing to run on the form that is implicitly run when the form is set as the application StartupUri?
|
# ¿ May 5, 2010 19:58 |
|
chocojosh posted:Are you dynamically creating the hosted control in code behind, or is it declared in XAML? Actually I solved this earlier today. It turns out it was because the resource dictionary containing the default style/template for the control wasn't "Themes/Generic.xaml".
|
# ¿ May 7, 2010 03:17 |
|
WPF DataBinding question here. I have an object, Foo, and a custom control, FooDisplay, I want Foo bound to. When changes are made to Foo, I would like to see them reflected in FooDisplay with as little additional code written as possible. I'm really just learning WPF so if I'm going against the grain with any of my approaches, please feel free to point it out. I'm trying very hard to avoid picking up bad habits. Right now I have my app structured like this: My Application class has a field of type Foo. I have a window for hosting FooDisplay and it has a DepenedencyProperty of Foos type. In my Application.OnStartup, I set this property to the instance of Foo that is created when App is. The only way I have been able to make the UI update as I make changes to Foo is by making individual properties of Foo into DependencyProperties. This seems like a "bad thing" though because it seems to be making a very tight coupling between my business objects and presentation code. Also, I dread the thought of making every property of it a DependencyProperty, even with the propdp shortcut. I'm trying to keep close to an MVC style doctrine to this and would appreciate any pointers on WPF application structure anyone may have.
|
# ¿ May 9, 2010 21:14 |
|
|
# ¿ May 22, 2024 11:16 |
|
I've been writing an ASP.NET MVC web application and have been trying to adhere to a lot of "best practices" like Localizing , using an IoC container and unit tests. I use the email address of a user to authenticate them. Given the fact that in the view, the HttpContext only has a reference to the users email address, is it a "Bad Thing©" to do something like the following from within a view?code:
|
# ¿ Dec 28, 2010 16:37 |