asp.net

Entity Framework Error on Model Creation

I am a newbie to the Entity Framework. I am trying to generate a model from my database and I get the following errors: '_Content' is already declared as 'Private _Content As Integer' in this class. 'OnContentChanging' cannot be declared 'Partial' because only one method 'OnContentChanging' can be marked 'Partial'. 'OnContentChanged'...

asp.net inline versus codebehind which do you use and why?

I've done it both ways, and to be honest other than the ability to give the code and webform to two different people (which doesn't happen where I work), I see very little advantage of one method over the other. I can understand how it is nice to have your code in one file, and markup in the other, but I can also understand the ease of h...

i am getting blank page while deploying MVC application on IIS

I am currently deploying my application built using RC of MVC ASP.NET on the production server which is showing nothing now. The routes in my global.ascx are typical i.e. routes.MapRoute( "Default", // Route name "{controller}.aspx/{action}/{id}", ...

How to prevent a user from having multiple instances of the Same Web application

I'm wondering if it is possible to determine if a user already has a web browser open to the web application I'm working on. It seems that they can open several instances of the same web app and click on buttons to read information that they have used before to enter into an input screen that they're currently working on. What happens t...

How to set DIV width/height with Javascript in Firefox

The following works in IE, but not Firefox: var el = $get('divToMask'); var box = Sys.UI.DomElement.getBounds(el); var maskEl = $get('maskDiv'); // Only seems to work in IE maskEl.style.width = box.width; maskEl.style.height = box.height; Sys.UI.DomElement.setLocation(maskEl, box.x, box.y); box.width and box.height contain the corr...

ASP.NET server control property issue(?)

I am working on some ASP.NET Server Control, and I have an issue. Maybe I oversee something, I don't know. Anyway: public string Name { get { String s = (String)ViewState["name"]; return ((s == null) ? String.Empty : s); } set { ViewState["name"] = value; } } protected override void R...

Career with PHP or ASP.NET?

I started programing in 'Jan 2006', with .NET framework as a desktop application developer. In the same company I worked for exactly two years with VB.NET (desktop and web applications (asp.net)). Actually I changed my job due to some problematic situation in the company. When I was facing these problematic situations my frined offered...

ASP.NET: Unfamiliar with Interfaces

I'm building a decent sized application in ASP.NET/VB.NET with various objects... I've never used interfaces before, and a fellow programmer balked when I mentioned this to him. Can anyone give me a quick overview on how they're used, what they're used for, and why I would use them? Maybe I don't need to use them for this project, but if...

n-tier design, lookup tables, and custom entities

Hello, In an n-tiered application where you are using custom entities, how do you find yourself handling data needed from lookup tables? Do you create entities for each of these lookup tables or employ some other strategy? For example. I have a "Ratings" lookup table that will be used to populate a dropdownlist. Would you create a ...

Best practices for DataBinding in asp.net for maintainability

Hi, I would like to know what are the best practices for using asp.net DataBinding, in terms of maintainability. I don't want the application to fall appart when I have to make changes to the database. Should I databind completely in codebehind ? I am planning on using ObjectDataSources for the databinding. Is there something that is ...

Numbering comments in ASP.NET and MSSQL

I've just thought about best way to store comments in database with appropriate numbers according to the article. The idea is to store comments with composite primary key (commentId, articleId) where commentId is generated according to the given articleId. The system of generating should has same principle as IDENTITY generated columns ...

Exception handling in ASP.NET Webforms

What is the preferred method for handling exceptions in ASP.NET Webforms? You have the Page_Error method that you add (I think) at web.config level, and the entire site gets redirected there when an error occurs. Does that mean you shouldn't use try-catch anywhere in a webforms application? (Assuming you don't want to hide any errors) ...

What is the easiest way to get 4(or any count) random unique ids from an id collection with c#?

Assume that you have an idCollection IList<long> and you have a method to get 4 unique ids.Every time you call it, it gives you random 4 unique ids ? var idCollec = new[] {1,2,3,4,5,6,7,8,9,10,11,12}.ToList(); For example {2,6,11,12} {3,4,7,8} {5,8,10,12} ... .. What is the smartest way...

solution structure / best practices

I just recently started a new personal project, with a goal of having it able to scale from the start. I got a suggestion for the structure, to create something like this: <solution> |-- project.client.sql.queries |-- project.admin.sql.queries |-- project.client.business.logic |-- project.admin.business.logic |-- project.client.web.ui...

AJAX.NET and ListBoxes

I have an UpdatePanel with two ListBoxes in them. What I want to happen is that when the page loads the first ListBox fills with some data. When the user selects and item the second ListBox should be populated with the pertinent data. Here is what happens, the first ListBox is filled with data, the user selects an item and the Selecte...

Asp.Net MVC - Rob Conery's LazyList - Count() or Count

I'm trying to create an html table for order logs for customers. A customer is defined as (I've left out a lot of stuff): public class Customer { public LazyList<Order> Orders { get; set; } } The LazyList is set when fetching a Customer: public Customer GetCustomer(int custID) { Customer c = ... c.Orders = new LazyList<O...

Displaying pictures/photographs in asp.net website

I want a really nice way to load in pictures onto a webpage, like a portfolio of my work (let's say it's pottery that I sell on the web) - various fade effects and the like - what can you recommend? Is there something in JQuery? Thanks ...

.NET User Management Customization

I was wondering if anyone could point me to some resources concerning customization of the user management system that is built in .NET. What I am talking about is: http://msdn.microsoft.com/en-us/library/ms998347.aspx I would like to know, how can I extend the user fields to store more than just common password, username? I want to s...

Is it OK to go from Hashed to Encrypted password type in an ASP.NET membership provider?

I've have an asp.net web app, forms authentication, that's uses Hashed password type. Will I run across any problems if I change the password type to Encrypted? I see that, if I change to Encrypted, attempted password recovery for old hashed passwords fails gracefully, which is good. Are there any not so good things that might show up ...

Why is my asp.net caching throwing an exception?

I have a bunch of simple lookup tables cached in my asp.net application since the source data is on a seperate server from our main web architecture and it changes infrequently. I've been following answers here and various documentation and I have my initial load function call the following: HttpContext.Current.Cache.Insert("CheckLocati...