asp.net

ASP.net MVC - rendering a List containing different types, with a different view for each type

Imagine I have a list of objects that implement an interface called ISummary The objects within this list MAY have additional properties ie. public interface ISummary { Guid Id {get;set;} string Title {get;set;} DateTime Created {get;set;} } public class GigSummary: ISummary { Guid Id {get;set;} string Title {get;set;} DateTim...

How to ensure the right DateTime is used?

I have a Silverlight client that talks to some ASP.NET web services, which then modify a database. The client has data that can be modified and sent via the web services to the database. This data is organised by date. Obviously, the client can reside in a different timezone to the ASP.NET server, so, how do I ensure that the DateTime i...

HTTP Handler works using Cassini, but not with IIS 6

I've created a sample project to simplify my problem. I have this simple handler: public class HandleThis : IHttpHandler, IRequiresSessionState { public void ProcessRequest( System.Web.HttpContext context ) { // Score.aspx just says "success" context.Response.Redirect( "Score.aspx" ); } public bool IsR...

WIA through web browser - ASP.NET

I am wondering what would be the best/preferred way to write a scanning app that lives in a web browser. The basic idea is I want to use a web page from where I can click a button which will scan a document on the client and upload that document to server. The first thought that came to mind is write a native (C++?) browser plug-in. Howe...

Change Sender URL in ASP.NET

Hi, i wanna change sender PAGE URL to anything in my website. For example i got a webpage named "DEFAULT.ASPX" thats got a Form tag action="http://otherpage.aspx".When i submit form its sending my values thats in form to otherpage.aspx.This page is gettin them and do its work. But otherpage.aspx is looking for sender page url and s...

Calculating the bandwidth between a client and the server?

I have an app that calls my ASP.NET page on my server, every 30 seconds. I want to use this for two purposes: Graph the uptime of my client Graph the average bandwidth from my client to the server What is the best way to calculate the bandwidth (in bytes per second) from the client to the server? I assume that I record the time, ca...

How to Stop Browser from Closing Using ASP.NET or Else ?

hi, i got a web page and when browser fire Closing Event i wanna stop it ? How can i do that in asp.net or anyother alternative? ...

Error Viewing ASP.NET applications After Installing IIS7.5

I get the following error when I try to access a asp.net application on my local machine. Anyone have any ideas? HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Module IIS Web Core Notification BeginRequest Handler Not yet...

ASP.NET RESTful Web Service

I've been reading a lot about web services and I've come across the case where one could be very useful. I've been thinking of implementing it with WCF but the host will be ASP.NET in a shared hosting environment with medium trust so from what I've read WCF doesn't seem like an option. Also, I'm thinking of a RESTful web service and SOAP...

Hide a field in silverlight data form with data annotations

Which DataAnnotation attribute can I use to instruct the silverlight data form not to show that field? ...

Publishing a SQLExpress Database from Visual Studio

I have tables in a local database I've built in Visual Studio 2008 that I want to publish to an existing database on the server that I will be deploying my Asp.NET app. Unfortunately the only two options I have for deploying this database when I select "publish" is -script to file- and -publish to shared hosting provider-. My dedicated...

asp.net iText dll implementation help

Hi, I have a function for reading and creating a pdf file. I was told it uses iText.dll, but not sure where to find it and implement it. Can anyone point me in the right direction. Im a .net newbie. I dont need help with the code right now, so just setting up the dependancies would be a good start. Any help would be great Thanks --Ma...

How to truly remove all references from VS 2008 project?

I have a Visual Studio 2008 project that has a reference to a dll. I removed the reference to version 1 and added a new reference to version 2. The project builds successfully, however when I analyze the project dll after it has been built in Reflector I am seeing that it is holding onto two references to the same dll - version 1 and ver...

Button_Click Event not raised due to CompareValidator

I have a page containing an <asp:Button/> to leave the page and a <asp:TextBox/> to get some date and another <asp:TextBox/> to confirm that data. The confirm validator is configured as follows: <asp:CompareValidator ID="CompareValidator" runat="server" ErrorMessage="error message" ControlToValidate="ConfirmTextBox" ControlToCompare="Te...

Manage ASP.NET Web Service Source Code

I'm working on building a set of ASP.NET (2.0) web-services to be deployed into a single web application under IIS7. The services will be added incrementally (over a period of a year or more) by multiple programmers. How should I organize my source in VS2005. Should I use one project or several? Should I use a Web-Application or Web-Si...

ASP.Net machinekey, validationkey, and decryptionkey - key lengths

What are the default key lengths that are generated when leaving the ValidationKey and DecryptionKey at their defaults? For example: <machineKey decryptionKey="AutoGenerate,IsolateApps" validationKey="AutoGenerate,IsolateApps" ... /> I have not been able to find this documented anywhere on MSDN. I would like to generate a static mac...

ASP.NET AJAX Toolkit - CalendarExtender is reset on Postback

Hello, I have an ASP.NET page that has two input elements: A TextBox that is ReadOnly. This TextBox is the TargetControl of a CalendarExtender A DropDownList with AutoPostBack=true Here is the code: <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2">Date:</td></tr> <tr><td colspan="2"> <asp:TextBox ID="d...

Can I avoid an unnecessary variable being created in this function?

I have got a very simple function that takes anything in as an object, but generally a string, and attempts to format it in a specific date format that we use for reports at work. The function is generally called using the OnRowDataBound event of a GridView and returns the date as a string if it could parse it or the original input as a...

<%$, <%@, <%=, <%#...what's the deal?

Hi all. I've programmed in both classic ASP and ASP.NET, and I see different tags inside of the markup for server side code. I've recently come across a good blog on MSDN that goes over the difference between <%= and <%# (<%# is evaluated only at databind, and <%= is evaluated at render), but I also see <%$ and <%@. I believe <%@ lo...

What are the rules around httpHandler paths in ASP.NET?

Is there a good resource for the rules around how the httpHandler path property is used? I am seeing mixed results for when my handler is called in different environments, so let me explain... I want to allow for a URL such as: http://mysite/_layouts/myCompany/rest/myservice.svc/param1/param2 I would like to invoke my handler only u...