asp.net

What are the key concepts to know when migrating my mindset from ASP.NET to ASP.NET MVC (2) ?

I'm currently working with ASP.NET and about to start learning ASP.NET MVC (2). So before I open the first thick book and go through the first lengthy tutorial, what are the most important (new) concepts to keep in mind? What are the main new features I should be aware of? Thanks a lot. ...

ASPX editor in ASP.NET MVC warning about a 64-bit assembly

I'm using OpenCV via EMGU CV. Since there are separate assemblies for x64 and x86, I'm compiling my entire website solution for x64. I ran into one problem where the built-in debugging web server freaked out at the x64 binaries, so I started debugging in IIS instead, and that solved most of my problems, except for this one warning that ...

Invisible borders in html table not quite invisible?

I have some tables in my asp.net mvc application for layout purposes. Even though I usually use divs for most things, in some cases tables make most sense because they already have exactly the layout I'm after in these cases. The only problem is, as far as I know the borders are supposed to be invisible unless you specify a width and st...

how to represent a list of U.S. States

Trying to do TDD against FluentValidation and Looking for the proper way to represent a list of US States. For example, I have an "Address" object. I would like to write a test (and a FluentValidation rule) that declares the address invalid if it's not in a list of US States. This is a finite list, only to include the 50 US States, ...

ASP.NET invalid element name StartTag error

For some reason, I'm getting this error when trying to test a code page on my computer. It may have something to do with a faulty IIS installation, but I can't seem to find out what the problem is. I get the following error: error on line 1 at column 2: StartTag: invalid element name Here is my Default.aspx: <%@ Page Language="C#" %...

Geolocation Error with IP Address 127.0.0.1

ok so I tried implementing this http://ipaddressextensions.codeplex.com/ It is displaying the output as:- 127.0.0.1 RESERVED ZZ What on earth is this RESERVED and ZZ ?? It should be displayed as INDIA IN the IP address is of the local host..alright..but what about the country name and country code ? Why won't they display correct...

ASP.NET + Nhibernate object rebind to session

Hi, guys I want to store my object in ASP.NET Session. This object has some lazy loaded properties. When I do postback to my page and get my object from Session, this properties throw LazyInitializationException. Can I rebind this object to newly creates Nhibernate Session to retrieve this properties or I have to create Session and get ...

Customizing asp.net webforms markup

I'm a new comer to the asp.net world. I hear a lot about asp.net mvc and it's advantage over webforms about the ability to customize the markup and css. I also heard that asp.net is much easier to learn than asp.net mvc so I decided to go for asp.net and webforms. My question is: what's the level of customization a web developer/designer...

Referencing AppSetting in Select property of SqlDataSource control

Hello everyone. A simple problem.... Got a SqlDataSource with a select, in this select I want to insert a value from web.config just like this <asp:SqlDataSource ... SelectCommand="SELECT field FROM table"></asp:SqlDataSource> well field is a value from web.config "Field" application setting <add key="Field" value="tablename"/> I ...

Is there ANY way a website visitor can see aspx.cs file's contents ?? just curious to know what all loop holes, breaks or whatever are there

just wondering....... ...

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index in C# asp.Net

Hi all, I am implementing Grid View in my application...When i try to delete a record from the Grid View it throws this error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index This is my Server side Code: protected void gridview1_RowDeleting(object sender, GridViewDel...

Beginner Asp.net C# ques about dynamically changing master pages

ok here's the thing... You fetch user's IP address and based on his/her country you redirect the user to a specific webpage..Now how do you change the master page dynamically ? this is how I am redirecting the user :- http://stackoverflow.com/questions/3690278/fetching-ip-address-and-displaying-country-in-c-and-asp-net its not like use...

Asp.net beginner ques: How do I use classA's variable in classB ?

I want to use variable "iso3166TwoLetterCode"'s value from this class http://stackoverflow.com/questions/3690278/fetching-ip-address-and-displaying-country-in-c-and-asp-net in my new test class..how do i use it ? Can I even use it ?? If, yes..how ? need this variable to use it in the if statement to check country code and based on the ...

How to apply custom url without using url-rewriting?

Hi, I am creating a dynamic website in asp.net based on content fetching from MSSQL DB. What I want to do is : everycontent has its own link/url based on contentId-Title. How can I do this? Example: Table has : ID :1 Title : Mytitle Description :This is description Extension : .html Url : Now, I need to show the all results in a dat...

BlogEngine.net hosted on Godaddy

I am hosting BlogEngine.net on Godaddy in a sub-directory configured in iis7 as an application. i.e. http://blog.domain.com The user can also navigate to the blog via http://www.domain.com/blog. This is making things a bit odd as files uploaded get referenced always through http://www.domain.com/blog/images/file.jpg as opposed to http:/...

About MVC 2 View mapping mechanism

Hello everyone I wonder mapping mechanism from controllers to views. I can not understand how mapping can be possible If we just return value of View() method. Controller class's View() method call overloaded View method with null parameters. But how can be possible to mapping to views with none specified returning value of View() metho...

WCF service timeout on asp.net page

Hi guys, I'm calling a WCF service on my asp.net site. sometimes this service is down and it takes 30seconds to timeout, which slows down my page as I'm calling syncronously. What's the best way around this? decrease timeout? is there a way to see if the service is down before calling? Thanks ...

Masterpage to detect response redirect

I want to clear a placeholder control on my masterpage every time a Redirect is being made. How can I achieve that in codebehind? I could check whether the last saved url and the current url match, but that is a really a makeshift solution I don't wanna' go for. Something like [if(//Page Redirect detected){//do something} ...

How do I cache a dataset to stop round trips to db?

I am creating a search results page in C# in an ASP.NET 1.1 page. In my data layer I have a DataSet that stores the result of a plain old ADO.NET stored procedure call. The DataSet has two DataTables and I'm using a DataVIew to filter and sort the columns. I only want to fill the dataset once, and then work on the DataTables and derived ...

Is there any way to get acces and change to Page before leave the server?

Hi, I want to change page content while it is going from the server because i need to add some advertisements inside the html elements that are advertisement holder. protected void Application_PreSendRequestContent(object sender, EventArgs e) this is good but i couldn't get access to HttpContext . Should i, i don't know :) But in thi...