asp.net

How do I add a CSS stylesheet to a WCF generated RSS feed?

I have a WCF service that uses a System.ServiceModel.Syndication.SyndicationFeed to create an RSS feed. But I'm having trouble figuring out how to add a Processing Instruction to output that points to my CSS stylesheet. What I need is a processing instruction that looks a bit like this: <?xml-stylesheet type="text/css" href="http://y...

How to make sure a user can only vote once on an ASP.NET poll.

I'm trying to make a ASP.NET (C#) poll that will ask a user a Yes/No question and log that vote to the database. To prevent spam I would like to be able to make sure users can only vote once. I've thought about logging the users IP address. If this is the answer can someone give me a tutorial that shows how this can be accomplished. If t...

Stairstepping piecharts with asp:chart control

I was perusing the asp.net chart control's sample website, and came across something in the pie chart gallery. There was 3 pie charts, "stair stepped" on top of each other. I starting using this control for a financial services application, and would like to replicate this effect. It looks like this: I'd post some code on what I've ac...

How do I get a user GUID from a selected item in a DropDownBox that is databound to a LINQ datasource?

This should be pretty straight forward but I can't seem to get my newbie mind around it. I have a ASP.net page that needs to create a new database entry based on user input from a web form. One control in the form is a DropDownBox that is databound to a LinqDataSource whose context is a LinqToSQL data class. The table it is bound to is...

How to display group data seprately using DataList in ASP.NET?

Hi, I have a sql table which have the following data, Id City Country --- ------ ------------ 1 Delhi India 2 New York United States 3 Karachi Pakistan 4 Mumbai India 5 Lahore Pakistan 6 Kanpur India 7 Delhi India 8 Mumbai India Now, I want to display the above data in my web...

ASP.NET Application setting debug="false" in web.config breaks Javascript

We have an application that works fine when we have debug="true" in Web.config, when we set this to "false" however the application stops working. It seems as if object inheritance is not working in the javascript (Microsoft JScript runtime error: Object doesn't support this property or method). Has anyone come across this before? A bit...

System.Web.AspNetHostingPermission SecurityException when trying to use ManagedFusion Rewriter on Goddaddy

Hello Everybody. I wonder if someone could help me out with an issue I'm experiencing trying to get my site up and running on Goddaddy. I'm trying to get extension-less url rewriting working using the ManagedFusion Rewriter (http://www.codeplex.com/urlrewriter/) Unfortunately I'm getting the following error: Server Error in '/' Applicat...

.Net Custom Libraries?

Where can I get custom libraries for ASP .Net? Specifically I am looking for ready made database access library that allow me to select, insert and update a database using transactions. I know how to do create but I am trying to use an existent library that does all that and handles exceptions and errors so exempt from the hustle of crea...

file upload error

Hello everyone, Here is my code at both client side and server side. My code is simple, just upload a file to an ASP.Net web site. My client code throws exception when it works on Vista (x64, Enterprise, SP1), but works fine on Windows Server 2003. Any ideas? 10.10.12.162 is my server address. [Code] Client: static void Main(str...

ASP.NET: Your most used httpmodules

Interested in description of your most used ASP.NET httpmodules that solved a specific problem for your webapp. Best practices and in-the-field usages are welcome. ...

Programmatically set height/width of image from database.

I'm having trouble consistently setting the width and height of an img tag. The img src is pulled dynamically from a database. The images being pulled from the database can have varying widths and heights so I need to set the img control. Sometimes the width and height are set properly and sometimes they aren't. I can't figure out why. A...

EventValidation - Missing __EventValidation value in few requests

We have a textbox inside an update panel and it postsback on text change. Around 1 in 1000 POST request to server is missing the __EventValidation form element ( we verified using the logs that, when this exception occured the request was missing this form element ) As this is not happening consistently, we are ruling out any coding iss...

ASP.NET, SQL Server, LINQTOSQL and Date formats

I am setting the locale of my .net application via: string userLocale = Web.Helpers.LocaleHelpers.GetBestRFC3066Locale(this.Context.Request.UserLanguages); if (userLocale != String.Empty) { System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCul...

Asp.net E-commerce performance

I am developing e-commerce project on Asp.Net 3.5 with C#. I am using 3 tiers (Data + Business + UI) structure to reach the data from database (Msql 2005). There are stored procedures and everything going on from them.(CRUD methods) There is a performance issue here, project is running so slowly. I couldn't find any problem in transact...

Best framework for Unit-Testing some legacy ASP.NET 1.1 code

I have legacy asp.net 1.1 website. It has a very poor VB layered achitecture. Debugging takes about 10 minutes to run the credit card processing tests. I'd like to add some unit testing capabilities to the solution to check my changes. I was thinking about using mbunit with galleo. Will mbunit and galleo work with my .net 1.1 code...

IRepository confusion on objects returned

I have some e-commerce code that I use often that uses Linq To SQL for saving orders to the database. I want to remove the tightly coupled Linq to SQL bit and pass in an IRepository instead but I am still a little confused on things. Say I have a GetCustomer() method on my ICustomerRepository that returns a Customer object. Do I need...

ASP.NET MVC - CSS Class in a ViewUserControl - The class or CssClass is not defined.

I have a <table/> in a ViewUserControl that I have given the tag a class="tblRaised" attribute/value. Visual Studio keeps underlying tblRaised and telling me - The class or CssClass is not defined. Why is the intellisense engine trying to validate my CSS class names here? Anyone else run into this? Is this a bug? How would intellisense...

Javascript confirmation dialog - ASP.NET

I saw a couple of similar questions on the same topic, but none of them addressed my issue. I've got a asp.net website, and want to show a status message (asp:label that will disappear in 5 seconds) to the user after the database was updated. i want to assign the text to the label, and then hide it with javascript. i got the js part ...

32-bit Build Server and 64-bit Production Server for .NET Web Apps

Our workstations are running 64-bit Vista, and the production servers for our ASP.NET MVC web apps are 64-bit Server 2008 servers. However, our build server running TeamCity is a Server 2008 32-bit server. We will taking these builds and deploying them on the 64-bit production servers. The applications are written all in C#. Should I...

Changing favicon based on theme

Is there a built in way to change the favicon for different themes? If not would it be as simple as creatign a custom control to emit the link tag with the correct url to the icon? Update So based on what I have found in order to do this, it looks like I am going to have to create an http handler that will intercept all calls for favi...