Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
wwb
Aug 17, 2004

Yup. We have had a few intranet apps here that used windows integrated auth. When alternate browsers and macs started hitting people had caniptions as the login was so silently effective that no one realized they were logging in (or that I was logging their every move).

Adbot
ADBOT LOVES YOU

Dromio
Oct 16, 2002
Sleeper
I have a feeling this is "a bad idea", but I'm curious enough to risk asking anyway.

We are using EF Code-first. We have a "Pay" entity in the database that contains an amount and an "EarnedDate". However, they are not allowed to be withdrawn until two weeks later.

The logic is simple enough, but there are a lot of reports and other things which rely on this basic rule. I could create some sort of withdrawal manager class that makes sure that all functions dealing with withdrawals only include Pays that are two+ weeks old, but I know some developer will forget at some point and include extra pays in a report.

I'm wondering if I could create a Second mapping entity and have it only map to db rows where the EarnedDate is over two weeks old. So if I accessed Context.Pays it would include all, but Context.Earnings it would only include ones over two weeks old.

Is it possible? If it's the bad idea my gut tells me it is, does anyone have a suggestion (other than rewriting the db schema) that would keep us from forgetting this in a report somewhere?

weapey
Jun 11, 2003

stomp stomp stomp
You can create a view on the database, and map your class to that like it was a table.

We typically solved that problem with a service-orientated architecture, so your business layer would only get access to the data store through methods provided by the service layer, so we could control exactly what that layer would return.

epswing
Nov 4, 2003

Soiled Meat
Hey WPF people, I'm loading a 75x120 pixel PNG from the web, stuffing it into a BitmapImage like so

C# code:
BitmapImage image = new BitmapImage();
image.BeginInit();
image.UriSource = new Uri(req);
image.EndInit()
and displaying it with an <Image /> like so

XML code:
<Image Source="{Binding Path=Img}" Stretch="None" Width="75" Height="120" />
Here's what I get:



The left is the WPF app, the right is Chrome. I have Stretch set to None, why does the image in WPF look so crappy?

Rottbott
Jul 27, 2006
DMC
Have you set SnapsToDevicePixels?

Sedro
Dec 31, 2008
You need to set RenderOptions.BitmapScalingMode on the Image control (WPF 4+ only).

epswing
Nov 4, 2003

Soiled Meat
Thanks for the suggestions. I've set SnapsToDevicePixels and BitmapScalingMode, to no effect.

XML code:
<Image Grid.Column="2" Grid.Row="1" Grid.RowSpan="3"
       Cursor="Hand"
       MouseUp="btnMap_Click"
       Source="{Binding Path=Img}" 
       Stretch="None"
       SnapsToDevicePixels="True"
       RenderOptions.BitmapScalingMode="HighQuality"
       Width="75" 
       Height="120"  />

Sedro
Dec 31, 2008
Try NearestNeighbor instead of HighQuality.

Make sure the image is pixel aligned, ie. no 0.5 px margins. You can force pixel alignment by applying UseLayoutRounding to the root element.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.
Maybe the image isn't really 75x120, somehow, I don't know? Does it look any better if you take out the size specifications?

epswing
Nov 4, 2003

Soiled Meat

Sedro posted:

Try NearestNeighbor instead of HighQuality.

Ding ding, this was it. Thanks guys.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.
Okay, who wants to play Tell Me What Blindingly Obvious Thing I'm Missing? I've got an MVC website that I'm putting up on an IIS 7 server. Unfortunately, when I put it up, I get a directory view instead of, y'know, a website. We've got another MVC site that works fine. I tried moving the new site to the old one's AppPool (it was on its own AppPool for some reason, even though all the settings look the same as Default to me). Didn't work, so it's not AppPool settings. I deleted the site's code and put a copy of the working MVC site in the folder instead. Didn't work, so it's nothing local like web.config. That just leaves some specific application setting that I'm just... not... seeing. Microsoft's documentation claims that as long as I'm using a working AppPool I don't need to do anything else, which is unhelpful. MVC isn't my strong suit (not by a mile, I'm still learning it) and I didn't set up the working one, my boss did, and he's since forgotten what he did to make it work. I'm stumped.

edit: I got it! Mostly! I had to change PageHandlerFactory-ISAPI-2.0's extension to "*" from "*.aspx". Now everything works but the .css.

CapnAndy fucked around with this message at 20:01 on Feb 4, 2013

mortarr
Apr 28, 2005

frozen meat at high speed
I'm building an ASP.Net MVC4 data entry page for invoices, and I'm not sure how to handle the detail part of the master/detail view.

My invoices have a customer and some notes, which is just like any other MVC create/edit page, and then I need to add/remove line items - these have some behaviour dictated by a couple of drop downs that cause other fields to show or hide, plus calculate line item price, and then the total price needs to be calculated too.

I'm struggling to find the "standard" way of doing this in MVC - I started out hand-rolling DOM manipulation javascript using D3.js (because I'd used it in a previous project), but then I came across knockout.js as a way to template the line items DOM stuff and behaviour (which seemed a bit easier than hand-rolling)...

I'm getting the feeling that I'm missing something fundamental in MVC, but google isn't being very helpful at the moment, does anyone have any pointers or examples?

mortarr fucked around with this message at 21:43 on Feb 6, 2013

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

mortarr posted:

I'm building an ASP.Net MVC4 data entry page for invoices, and I'm not sure how to handle the detail part of the master/detail view.

My invoices have a customer and some notes, which is just like any other MVC create/edit page, and then I need to add/remove line items - these have some behaviour dictated by a couple of drop downs that cause other fields to show or hide, plus calculate line item price, and then the total price needs to be calculated too.

I'm struggling to find the "standard" way of doing this in MVC - I started out hand-rolling DOM manipulation javascript using D3.js (because I'd used it in a previous project), but then I came across knockout.js as a way to template the line items DOM stuff and behaviour (which seemed a bit easier than hand-rolling)...

I'm getting the feeling that I'm missing something fundamental in MVC, but google isn't being very helpful at the moment, does anyone have any pointers or examples?

Partial views?

uXs
May 3, 2005

Mark it zero!
How would you guys handle this:

Say you want to copy an object. When you first write the method/whatever to make the copy, you decide for each property/field/whatever if you want to either copy the property/... or ignore it. So hooray.

Then later you add another property to the class, and you forget to handle the extra property in the copy method. This is bad because you may want it copied and then your users will panic and hell will open and swallow you whole.

So, any fool-proof and simple way to ensure that you never forget to either copy new fields, or explicitly not copy them? Preferably with some kind of unit test failing. I just can't think of a reasonable method to handle this.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

uXs posted:

How would you guys handle this:

Say you want to copy an object. When you first write the method/whatever to make the copy, you decide for each property/field/whatever if you want to either copy the property/... or ignore it. So hooray.

Then later you add another property to the class, and you forget to handle the extra property in the copy method. This is bad because you may want it copied and then your users will panic and hell will open and swallow you whole.

So, any fool-proof and simple way to ensure that you never forget to either copy new fields, or explicitly not copy them? Preferably with some kind of unit test failing. I just can't think of a reasonable method to handle this.

I'd probably go with attributes. You can still forget to decorate the property with the attribute, but at least you're doing it right at the property level, not buried somewhere else in the code.

Eggnogium
Jun 1, 2010

Never give an inch! Hnnnghhhhhh!
You could use a DoNotCopy attribute and reflection to iterate over the properties and fields of the object and copy any that don't have the attribute. Then you get the opt-out behavior you're asking for.

mortarr
Apr 28, 2005

frozen meat at high speed

Ithaqua posted:

Partial views?

I can get editable partial views going with just text boxes, but how would you deal with anything more complex, like parent-child drop downs, calculated fields etc?

aBagorn
Aug 26, 2004

mortarr posted:

I can get editable partial views going with just text boxes, but how would you deal with anything more complex, like parent-child drop downs, calculated fields etc?

jQuery and Ajax.

At least that's how I do it

Destroyenator
Dec 27, 2004

Don't ask me lady, I live in beer

uXs posted:

How would you guys handle this:

Say you want to copy an object. When you first write the method/whatever to make the copy, you decide for each property/field/whatever if you want to either copy the property/... or ignore it. So hooray.

Then later you add another property to the class, and you forget to handle the extra property in the copy method. This is bad because you may want it copied and then your users will panic and hell will open and swallow you whole.

So, any fool-proof and simple way to ensure that you never forget to either copy new fields, or explicitly not copy them? Preferably with some kind of unit test failing. I just can't think of a reasonable method to handle this.
Check out Automapper?
It will try to map every matching field, can warn you on missing/mismatched fields (in a unit test AssertConfigurationIsValid), can either ignore fields by attribute or fluently when configuring.

osigas
Mar 4, 2006

Then maybe you shouldn't be living here

aBagorn posted:

jQuery and Ajax.

At least that's how I do it

Yes this. Create a new Action you call through the Ajax, so you can still handle all the logic server side in your Controller.

Your new Action can return the data you need in whatever format you want it (full HTML, Json, etc.).

Dromio
Oct 16, 2002
Sleeper
I'm struggling a bit with modularity and reusable code using Entity Framework. I have some slightly complex logic to determine sales for a user, something like this (simplified, but enough to go on):

code:
public int GetSalesVolume(int ID)
{
return from user in UsersTable
join sales in SalesTable.DefaultIfEmpty() on sales.UserID equals user.ID
join payouts in PayoutsTable.DefaultIfEmpty() on payouts.UserID equals user.ID
where user.ID == ID
select (sales.sum(s=>s.Amount)) - (payouts.sum(p=>p.Amount))
}
Now, I want to do a query that returns a specific user with their sales:

code:
from user in UsersTable
where user.Region = TheRegionToCheck
select new{User = user, Volume = GetSalesVolume(user.ID)}
This sort of thing always confuses the SQL parser for EF-- "System.NotSupportedException : LINQ to Entities does not recognize the method 'Int32 GetSalesVolume(Int32)' method, and this method cannot be translated into a store expression"

Is there something I can do to my original query to make it reusable within other queries like this? Of course I could just call one query to get the user by region, then another to get the volume, but I want to avoid some situations where I'd end up with a ton of calls to the db if I need to get the volume for a lot of users.

zokie
Feb 13, 2006

Out of many, Sweden

Dromio posted:

I'm struggling a bit with modularity and reusable code using Entity Framework. I have some slightly complex logic to determine sales for a user, something like this (simplified, but enough to go on):

code:
public int GetSalesVolume(int ID)
{
return from user in UsersTable
join sales in SalesTable.DefaultIfEmpty() on sales.UserID equals user.ID
join payouts in PayoutsTable.DefaultIfEmpty() on payouts.UserID equals user.ID
where user.ID == ID
select (sales.sum(s=>s.Amount)) - (payouts.sum(p=>p.Amount))
}
Now, I want to do a query that returns a specific user with their sales:

code:
from user in UsersTable
where user.Region = TheRegionToCheck
select new{User = user, Volume = GetSalesVolume(user.ID)}
This sort of thing always confuses the SQL parser for EF-- "System.NotSupportedException : LINQ to Entities does not recognize the method 'Int32 GetSalesVolume(Int32)' method, and this method cannot be translated into a store expression"

Is there something I can do to my original query to make it reusable within other queries like this? Of course I could just call one query to get the user by region, then another to get the volume, but I want to avoid some situations where I'd end up with a ton of calls to the db if I need to get the volume for a lot of users.

Look in to deferred execution, C# actually only executes your queries when you enumerate them etc. So keeping stuff as an IQueryable as long as possible means that it will reflect changes deeper down. This is what makes EF angry at you "this method cannot be translated into a store expression".

Dromio
Oct 16, 2002
Sleeper

zokie posted:

Look in to deferred execution, C# actually only executes your queries when you enumerate them etc. So keeping stuff as an IQueryable as long as possible means that it will reflect changes deeper down. This is what makes EF angry at you "this method cannot be translated into a store expression".

I changed the GetSalesVolume so it returns IQueryable<int> and have the callers use GetSalesVolume(ID).FirstOrDefault(). But I still end up with the same error, LINQ to Entities does not recognize the method ...

wwb
Aug 17, 2004

Linq does a great job of hiding it, but at the end of the day anything in that linq statement needs to be translatable to SQL and the EF query generator isn't smart enough to use your functions unfortunately -- it has no idea how to translate GetSalesVolume() to sql. So structurally re-use is hard.

As for getting past it, IIRC you can register custom methods with your EF ObjectContext. Or you could just inline that and call it a day.

Dromio
Oct 16, 2002
Sleeper

wwb posted:

As for getting past it, IIRC you can register custom methods with your EF ObjectContext. Or you could just inline that and call it a day.

The calculation for volume is more complex than my example and will be used extensively. It'll be a real pain for maintenance if I duplicate it all over the place. I'll look at registering custom methods with the Context.

Or I guess I could just move the logic into the DB as a stored proc or func or something that I could join against :(

wwb
Aug 17, 2004

That isn't a horrible idea honestly, especially if you've got enough abstraction built in that you can work with it in a code / testing level.

edmund745
Jun 5, 2010
One solution and one question.......

In a vb.net program I'm writing that draws a bunch of charts on bitmaps and displays them in pictureboxes/forms, for some reason one of the fonts I declared (as a regular fontstyle),,,, suddenly goes to bold fontstyle in the middle of the program.
???
What I found messing with it was that if I painted a white fillRectangle over the text area first, then the drawstring command goes back to printing text in regular style....... from them on. I dunno? The font is declared once (as a global) and it works 100% correct in every other instance it is used.

I have seen this problem mentioned a few times elsewhere, but the circumstances are different.
Some people do not paint the bitmap a base color before applying the text, and I knew about that already.
Some people get font weirdness when writing a program on one OS and then running on a different OS, but I am writing & running on the same Win7 PC.

-------

The question is about using the vb.net string.split() method. At one point I got the bright idea of using non-key characters (characters that non-techie people would never normally type) and so I randomly chose alt-20 {§} and alt-21 {¶} (some pages refer to these as the 'section' symbol and 'paragraph' symbol). And I found out that split() doesn't work {at all} with alt-21. Or does it?

I just assumed that maybe split() won't work with non-printing characters, but there are other reports that it does. Here is someone's account of using the section symbol-
http://stackoverflow.com/questions/1879860/most-reliable-split-character
When I switched the program to use the ` and ^ symbols instead, it worked perfectly.

I was trying to split a file that was written & read in text mode. Is there any restrictions about using non-printing characters in such a file? I casually looked around on the msdn site and could not find any.....

ljw1004
Jan 18, 2005

rum

edmund745 posted:

In a vb.net program I'm writing that draws a bunch of charts on bitmaps and displays them in pictureboxes/forms, for some reason one of the fonts I declared (as a regular fontstyle),,,, suddenly goes to bold fontstyle in the middle of the program.
???

I believe this is almost always due to running out of win32 GDI resources (brushes, pens, fonts, ...) And the solution is to be absolutely iron-clad sure that you're disposing each one as soon as you're done with it.


quote:

The question is about using the vb.net string.split() method. At one point I got the bright idea of using non-key characters (characters that non-techie people would never normally type) and so I randomly chose alt-20 {§} and alt-21 {¶} (some pages refer to these as the 'section' symbol and 'paragraph' symbol). And I found out that split() doesn't work {at all} with alt-21. Or does it?

Sure it does! Works fine. Here's an example:

code:
Dim a = "The¶quick¶brown¶fox"
Dim b = a.Split({"¶"c})
For Each c In b
    Console.WriteLine(c)
Next
I think you're more likely having a trouble with text-encoding. The paragraph marker isn't in the "!@#$%^1*()*+,-./0...9...A...a...z{|}~" range of standardised ascii. So if you have a non-unicode text document and load it in, it's hard to predict what the paragraph-mark will come back as.

edmund745
Jun 5, 2010

ljw1004 posted:

I believe this is almost always due to running out of win32 GDI resources (brushes, pens, fonts, ...) And the solution is to be absolutely iron-clad sure that you're disposing each one as soon as you're done with it.
I do all the graphics stuff in using,,, end using statements. Do the pens and brushes still need to be disposed? I had read that they didn't.

(The bitmaps are sometimes used in multiple displays so they are left persistent intentionally--but there is only a few in use, referred to by specific names)

quote:

...I think you're more likely having a trouble with text-encoding. The paragraph marker isn't in the "!@#$%^1*()*+,-./0...9...A...a...z{|}~" range of standardised ascii. So if you have a non-unicode text document and load it in, it's hard to predict what the paragraph-mark will come back as.
I dunno. The file in question is one used by the program, and it is written and read in text-mode. :|

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

edmund745 posted:

I do all the graphics stuff in using,,, end using statements. Do the pens and brushes still need to be disposed? I had read that they didn't.

Where did you read that? Pens and brushes are still GDI objects, so if you're creating new ones all the time and not cleaning them up then that will cause you to hit the handle limit.

ljw1004
Jan 18, 2005

rum

edmund745 posted:

I dunno. The file in question is one used by the program, and it is written and read in text-mode. :|

Written and read in text-UTF8? text-UTF16? Some text-ASCII encoding? If so which codepage?

Just saying "text mode" isn't enough! I reckon if you change every single file-open and file-close to explicitly say UTF8, it could work. Also be sure that the way you express ¶ is the same in all cases. You can either write the symbol straight into your code (VS has a unicode text-editor), or you can call it Chr(182).

edmund745
Jun 5, 2010

Jabor posted:

Where did you read that? Pens and brushes are still GDI objects, so if you're creating new ones all the time and not cleaning them up then that will cause you to hit the handle limit.
It is my understanding that normally graphics objects are persistent and need to be disposed--(that is the reason for the dispose method being there)--but the using/end using statement also automatically disposes of anything declared inside it.
http://www.dreamincode.net/forums/topic/265854-dispose-method-in-using-statement/
Does msdn say either way? I could not find where either topic mentions the other.

ljw1004 posted:

Written and read in text-UTF8? text-UTF16? Some text-ASCII encoding? If so which codepage? Just saying "text mode" isn't enough!
I dunno really. I just used streamreader in whatever default it is. That could have been part of the issue possibly.

Now I am looking and can't find what encoding it uses by default.... ?

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

edmund745 posted:

It is my understanding that normally graphics objects are persistent and need to be disposed--(that is the reason for the dispose method being there)--but the using/end using statement also automatically disposes of anything declared inside it.
http://www.dreamincode.net/forums/topic/265854-dispose-method-in-using-statement/
Does msdn say either way? I could not find where either topic mentions the other.

I dunno really. I just used streamreader in whatever default it is. That could have been part of the issue possibly.

Now I am looking and can't find what encoding it uses by default.... ?

It will try to detect the encoding of the file based on the presence of a BOM (byte order mark), which usually won't work. If it can't find a BOM it will fall back to UTF8. Here's the actual code (abridged):
C# code:
public class StreamReader : TextReader
{
    public StreamReader(Stream stream) 
        : this(stream, true) { 
    }

    public StreamReader(Stream stream, bool detectEncodingFromByteOrderMarks)
        : this(stream, Encoding.UTF8, detectEncodingFromByteOrderMarks, DefaultBufferSize) {
    }
    
    public StreamReader(Stream stream, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)
    { 
        if (stream==null || encoding==null) 
            throw new ArgumentNullException((stream==null ? "stream" : "encoding"));
        if (!stream.CanRead) 
            throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable"));
        if (bufferSize <= 0)
            throw new ArgumentOutOfRangeException("bufferSize", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));

        Init(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize);
    }
    
    private void DetectEncoding() 
    {
        if (byteLen < 2) 
            return;
        _detectEncoding = false;
        bool changedEncoding = false;
        if (byteBuffer[0]==0xFE && byteBuffer[1]==0xFF) { 
            // Big Endian Unicode

            encoding = new UnicodeEncoding(true, true); 
            CompressBuffer(2);
            changedEncoding = true; 
        }
        // [...] lots of other detection code
        if (changedEncoding) { 
            decoder = encoding.GetDecoder();
            _maxCharsPerBuffer = encoding.GetMaxCharCount(byteBuffer.Length); 
            charBuffer = new char[_maxCharsPerBuffer]; 
        }
    } 
}
DetectEncoding is called as soon as you try to read something from the file. Note that it will only ever detect Unicode encodings, so if the encoding is ASCII or something else it will never get it right. I try to always specify the encoding if it's at all possible.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

edmund745 posted:

It is my understanding that normally graphics objects are persistent and need to be disposed--(that is the reason for the dispose method being there)--but the using/end using statement also automatically disposes of anything declared inside it.
http://www.dreamincode.net/forums/topic/265854-dispose-method-in-using-statement/
Does msdn say either way? I could not find where either topic mentions the other.

Not quite.

The using block is equivalent to a try/finally block.

So, doing this:

code:
using (var foo = new SomeDisposable()) 
{
	var bar = new SomeOtherDisposable();
	foo.Stuff();
}
is equivalent to this:
code:
SomeDisposable foo = null;
try 
{
	foo = new SomeDisposable()
	var bar = new SomeOtherDisposable();
	foo.Stuff();
}
finally
{
	if (foo != null) 
	{
		((IDisposable)foo).Dispose();
	}
}
Basically, anything you want disposed needs to be in its own using block. It's not uncommon to "stack" usings to accomplish this and avoid excessive indentation:
code:
using (var foo = new SomeDisposable()) 
using (var bar = new SomeOtherDisposable()) 
{
}
[edit]
Fixed my try/finally

New Yorp New Yorp fucked around with this message at 18:31 on Feb 11, 2013

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.
So I'm making an MVC website (still), and part of that was changing the Handler Mappings so the path for PageHandlerFactory was "*". That's fine, it worked. I just noticed today though that all my CSS was blowing up, and after initially blaming the pathing I finally went to view one of the images directly and got a Failed to Execute URL error. I figured out that the "*" pathing for PageHandlerFactory has basically told the server to treat anything I haven't given it specific pathing rules for as a webpage. If I change the StaticFile path to "*" my images start working again; unfortunately this blows up the website, because now it's treating website/FolderName as a static file instead of trying to get the view that belongs to FolderName.

Do I seriously have to make a new handler for every single extension of every type of static file I want to use? This problem is nowhere on Google and I am not exactly the first person to use MVC, which leaves me with the sneaking suspicion I've screwed up somewhere.

Huragok
Sep 14, 2011

CapnAndy posted:

Do I seriously have to make a new handler for every single extension of every type of static file I want to use? This problem is nowhere on Google and I am not exactly the first person to use MVC, which leaves me with the sneaking suspicion I've screwed up somewhere.

Check out this MSDN article. Try setting your runallmodulesblahblah true (read up on why this is not a great idea though and see if it applies to your circumstances).

wwb
Aug 17, 2004

^^^ that is a good start.

It really sounds like something got buggered, I've never had to futz with the handler mappings from the default templates except when I was doing upgrades from MVC versions to different versions or I mucked something up.

If your app / site isn't too complex, I'd consider doing new project and then carefully re-adding your code, avoiding paving over the config files while you are at it.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

wwb posted:

^^^ that is a good start.

It really sounds like something got buggered, I've never had to futz with the handler mappings from the default templates except when I was doing upgrades from MVC versions to different versions or I mucked something up.

If your app / site isn't too complex, I'd consider doing new project and then carefully re-adding your code, avoiding paving over the config files while you are at it.

I'd also add that if you're doing MVC4, look into using bundles for your CSS/JS. It makes life a lot easier and handles minification for you.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.

wwb posted:

It really sounds like something got buggered, I've never had to futz with the handler mappings from the default templates except when I was doing upgrades from MVC versions to different versions or I mucked something up.
Really? So, like, servername.com/ControlName works for you without changing any mappings, or do you go to ControlName/Index.aspx? Because I've never made the former work without changing handler mappings.

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

CapnAndy posted:

Really? So, like, servername.com/ControlName works for you without changing any mappings, or do you go to ControlName/Index.aspx? Because I've never made the former work without changing handler mappings.

The former is how it's always worked out of the box for me.

  • Locked thread