r/ASPNET • • Oct 12 '12

Entity Framework + MVC 4 + Knockout.js AddView templates?

5 Upvotes

I've been messing around with knockout.js a little bit lately and it seems like it has a lot of promise. However, I can't seem to find any good Code Templates (aka t4 templates or .tt files) for it.

My GUESS is that the only changes that we would need would be on the view side, not the controller side, but I'd be up for looking at new controller templates too.

Where I am right now:

  • Create a new MVC 4 project

  • Using NuGet, install entity framework 5, jquery, jquery ui, and knockout

  • Create a .edmx model by reverse engineering your existing database with Entity Framework

  • Drag C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates from Explorer into the root of your project

  • Delete CodeTemplates\AddController

  • Highlight all of the items in CodeTemplates\AddView\CSHTML and blank out the text in "Custom Tool" in properties to keep them from building

  • Start screwing around with Create.tt and Edit.tt to add in knockout code.

Final Goal Expected Input: Right Click > Add Controller ... > MVC Controller using EF

Final Goal Expected Result: Controller & View created using EF with knockout code already in place.

If you use something similar to knockout that you like more, I'd love to hear about it!

Thanks for your time!


r/ASPNET • • Sep 24 '12

Snag Creating Controller in MVC4 with DB Generated .EDMX - Can I borrow some eyeballs to help me see what I'm doing wrong here? : The Official Microsoft ASP.NET Forums

Thumbnail
forums.asp.net
5 Upvotes

r/ASPNET • • Jul 20 '12

Need help understanding an issue with IIS, IWA, and maybe kerberos

5 Upvotes

At work, I have IE8 on XP, calling a .net 4.0 web app on WinServer 2003 with IIS6. IWA is turned on. When I call the page, the initial aspx page call of course will show 3 lines in Fiddler. First is anon request, second has some AUTHORIZATION:NEGOTIATE header, and then the 3rd has a longer value for the same header (probably a token). The first two result in 401 errors, the last is 200 success. But this is expected.

The issue: When the following files (CSS, JS, images) get called, mostly all of them (but not all) go through the same 3-step call. The first 2 are 401 errors, then the 3rd gives me the 200 code and the content.

Is this normal? I thought just the first call of the page itself is the only thing needing the 3-step process.

FYI- we had OAM and WebGate on the server, but we uninstalled it and we are still getting this behavior. Is it possibly the app pool doesn't have it's identity/domain ID setup right? I really don't want to turn the style, script and image folders on Anonymous.

Thanks!!


r/ASPNET • • May 24 '12

Help using a custom database for built in membership features in VS ASP.NET

5 Upvotes

Hi I am having problems getting the built in log in features to work on my web page.

I followed the instructions in this link to change the default database for the log in and membership features. It works on my local database but I can't seem to get it to work on the database on the hosting site.

I consolidated the databases so its accessing all the information from one database. I can access the database from the website I created but the log in feature returns an error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

please help


r/ASPNET • • Dec 22 '11

MVC - Do you create model classes when you create an entity model?

5 Upvotes

For models in my mvc3 app, I chose to add an "ADO.NET Entity Data Model" and generate the objects from the database. Obviously I can access those objects directly from my controller class, but is it good practice? Or should I write model.cs (i.e., the "AccountModel.cs" file that's generated when you use membership) file anyways?

Thanks.


r/ASPNET • • Nov 22 '11

Global SEO 301 Redirects in ASP.NET

Thumbnail
alligatortek.com
5 Upvotes

r/ASPNET • • Oct 25 '11

Can you recommend a good .NET VPS host?

5 Upvotes

I use Linode for Linux servers and I am quite happy with it. I am looking for a good and cheap .net equivalent.


r/ASPNET • • Jun 11 '11

Replacing a classic asp site with a new mvc version. Need some advice on how to handle old bookmarks and older URLs in general.

5 Upvotes

I'd really like to keep the classic asp URLs active for the new MVC site. It would be a shame to have all the bookmarks people collected from our site to land on a 404 page.

I imagine the best way would be to rewrite the url or just do a permanent redirect, but I'm not quite sure the "Best practice" way to handle this. Can Asp.net Routing handle all of this?

Our old URLs look like this product.asp?Id=123

The new ones are /product/product-name

Any tips, tricks, advice, or suggested reading would really be helpful.


r/ASPNET • • Jun 09 '11

I've been trying to figure this out for hours: How can I access a Repeater that I've added to a Panel?

5 Upvotes

I'm adding a dynamically created Repeater to a statically declared Panel like this:

Panel1.Controls.Add(Repeater1);

Page loads, controls all render, and everything looks good. Now I want to edit the data in the RepeaterItems of the Repeater control and save the modifications back to the database.

Can anyone tell me how to cast the object contained in the Panel1.Controls collection back to a Repeater so I can iterate through it?

EDIT: I should have specified that I am using Visual Studio 2008, .NET Framework 3.5, and C#


r/ASPNET • • Apr 02 '11

How would you handle widgets in MVC 3?

5 Upvotes

I have been working with some new MVC content, and I am considering creating some widgets for a website in which the owner of the website (free website created for a friend) would be able to specify widgets for specific articles.

The question the I have, is how would you all handle this? considering that the widgets would be known, and not completely generic in nature,would you create a base widget class; with representations for said widgets (which is how I figure I should flesh this out)? Or would you use a different mechanism?

For more specific reference, I expect each widget to have a partial exposure, with a base class which exposes the widget representation in the view, but specific representation would be handled.

What do you think?


r/ASPNET • • Mar 25 '11

Incremental Search help needed for MVC 3

5 Upvotes

Hey guys, I'm working on an MVC 3 project, and I'm trying to figure out a way to implement an incremental search (like the drop-down options Google suggests for a search based on what's being typed) feature into some of the text fields in a form. I've done something similar to this, but it was a few years back so it's escaping my memory and was mainly Java/javascript/HTML based. Any thoughts on a solution or directions to where a solution might lie would be greatly appreciated!


r/ASPNET • • Mar 10 '11

What technology do you recommend I use for my next school project?

5 Upvotes

ASP.Net MVC, Silverlight, WinPhone7, XNA? I get to choose any of these platforms. I don't know what the project will be yet, but I decide that too. It does have to be something business-related, so XNA is probably out.

I basically want to choose the platform that shows promise in terms of demand for developers in it.


r/ASPNET • • Feb 10 '11

Are their any tutorials on how to support live editing for multiuser collaboration on a user control or web form?

5 Upvotes

I am currently developing an ASP.NET AJAX server control which is essentially an interactive gantt chart. It has been identified that there could be cases where more than one user would be responsible for updating the chart, and due to this there is a chance they could be working on it at the same time. Is anyone familiar with any resources which explain how to handle concurrent editing? Preferably client and server side examples.

The best I can think of at the moment is to log the changes on the server as they happen with a timestamp and have the client poll for any changes that happened after the last polling interval. I happened to find this video: http://www.youtube.com/watch?v=3ykZYKCK7AM, but it was a little high level for me to formulate a plan of attack.

Any suggestions or advice would be appreciated.


r/ASPNET • • Feb 01 '11

Stock Market Ticker For Website Yahoo Finance API

Thumbnail
aspdotnetmatters.blogspot.com
5 Upvotes

r/ASPNET • • Dec 21 '10

Load WebForms and UserControls from Embedded Resources

Thumbnail
codeproject.com
5 Upvotes

r/ASPNET • • Sep 24 '10

MVC .NET URL Generation Done Right!

Thumbnail jacquette.com
5 Upvotes

r/ASPNET • • May 14 '10

What version of Windows 7 is best for VS 2010 & ASP.NET development?

5 Upvotes

r/ASPNET • • May 06 '10

ASP.NET Session Storage Issues

Thumbnail distributedcache.blogspot.com
5 Upvotes

r/ASPNET • • Apr 30 '10

ASP.Net MVC 2: ASP.NET MVC 2: Ninja Black Belt Tips by Scott Hanselman

Thumbnail
channel9.msdn.com
5 Upvotes

r/ASPNET • • Sep 01 '09

Simplify Iteration in Your MVC Views

Thumbnail blog.codeville.net
5 Upvotes

r/ASPNET • • Jun 12 '09

Framework for integration testing ASP.Net MVC apps

Thumbnail blog.codeville.net
5 Upvotes

r/ASPNET • • May 08 '09

ELMAH: Error Logging Modules and Handlers for ASP.NET (and MVC too!)

Thumbnail
hanselman.com
5 Upvotes

r/ASPNET • • Dec 11 '08

Ext Framework, jQuery and ASP.NET

Thumbnail
simple-talk.com
5 Upvotes

r/ASPNET • • Oct 28 '08

Zip Compressing ASP.NET Session without changing your code using a Session provider

Thumbnail alpascual.com
5 Upvotes

r/ASPNET • • Oct 07 '08

NET 3.5. SP1 best practices – When to use the ASP.NET MVC Framework

Thumbnail
blogs.msdn.com
5 Upvotes