asp.net

Posting a file from C# to ASP.Net

Hey, I have a C# client which once every hour needs to post some zip files to ASP.Net site. This needs to be completely automated with no user interaction. Wondering the best way to go about it. Ideally would like to post the file without setting up any non .aspx / .asp pages. Thanks for the help! ...

ASP.NET MVC AsyncController xxxCompleted

When implementing ASP.NET MVC AsyncController the xxxCompleted method has to be Public. I'm wondering if this means the xxxCompleted method can be invoked directly, or if this is protected internally using NonAction or something similar? Thanks. ...

Options for ASP.NET page with matching client-side and server-side markup?

Suppose I'm building a StackOverflow clone using webforms ASP.NET and jQuery. The Question page has a question, several answers, and comments under each. Requirements: Users can post new answers and comments, and edit existing ones, without postbacks. No UpdatePanels; the AJAX calls retrieve just the JSON they need, not HTML fragment...

How do you avoid XSS vulnerabilities in ASP.Net (MVC)?

I recently noticed that I had a big hole in my application because I had done something like: <input type="text" value="<%= value%>" /> I know that I should have used Html.Encode, but is there any way to do that for all values, without having to do it explicitly? ...

iis7 urlrewriting and sitemap

Hi. I'm using iis7 url rewrite module and make user friendly urls. But in my sitemap this is not like that. It is like .aspx?id=123&category=dasd So indexed on search engines and sitemap has different urls. (normally both of them goes to same page) but they are different. Is it problem or not? or what can I do? ...

Can't publish colleagues ASP.NET web application to a web server.

Hi, My colleague and I are both using VS 2010 and we have created a web application each. We can both publish our own applications to a ftp (web host's) and it works fine. However, if my colleague send me his solution and I run it locally on my machine it works but when I try to publish it I get promped for password and I enter it (same...

Streaming with Node.js, or any other Comet solution.

I'm trying to build a streaming solution for an internal app, but am drawing blanks for a solution to get past a roadblock. Currently, in my working example, I'm using APE, but due to restrictions I can't have any foreign running processes on the host machine, so I can't run the APE server. I'm looking for alternatives, but everything I...

apns-csharp certificate trouble

Hi everyone, I trying to use apns-csharp library to send push notification from .NET, I created certificate on Apple Provision Portal, download it and convert to p12 format, when i try to load it with code: private ActionResult SendAlertPushNotification(string appId, string notificationContent, bool useSandBox) { Not...

What is for the Html.AntiForgeryToken helper function?

Can somebody tell me more details about it? ...

Is there a way I can implement this specific kind of output cache for ASP.NET?

I want to run a custom logic, before the page life-cycle, to decide what version of a cached page I want to serve to the user. Example: If the user is not logged, then I go to a cache dictionary, catch a version A of the page and serve to the user. Otherwise, if it's logged, then I'll see if I already cached a version of the page sp...

How to manage complex data entry validation

I feel like I am fighting against the current when I develop ASP.NET Webform apps. I frequently run into the same problems, and while I eventually find some kind of workaround i'm never fully satisfied with the results. Here is an example of a typical problem: The design requires a grid or grid-like result set. This result set is pul...

Threading problem with Monitor.Wait() and Monitor.Pulse()

I have a producer-consumer scenario in ASP.NET. I designed a Producer class, a Consumer class and a class for holding the shared objects and responsible for communication between Producer and Consumer, lets call it Mediator. Because I fork the execution path at start-up (in parent object) and one thread would call Producer.Start() and an...

Dundas Chart in User Control

Hi, I have a dundas chart with ajax zooming and scrolling enable. It works fine in a webform page. But once I put in a user control and called it from another page I get this error - the target 'ctl00$ContentPlaceHolder1$uc2$chartVisits' for the callback could not be found or did not implement ICallbackEventHandler. -when I try to use...

How to test a returned array contains at least one value with a certain property value

Hi, say I have a method I wish to test: public Cars[] GetCars(); I want to test that the array returned by this method contains at least one car which is of type "Mustang". How would I actually do this? Currently I have code like: [Test] public void GetCars_ReturnsMustangs() { Cars[] cars = GetCars(); foreach(Car car in cars...

upload jpg/png/ gif photos

I was doing a test to upload pictures and i found out that when i upload pictures more than 2000px the webpage turn to be slow. I want users to upload pics with size not more than 600px and height 700px. Imports System.Data Imports System.IO Imports System.Data.SqlClient Partial Class PhotoAdmin_Default Inherits System.Web.UI.Page ...

Provide the ability to "hot swap" / change assemblies at runtime without re-starting a process.

ASP.Net allows you to copy new assemblies into the bin directory of an application without needing to re-start any services or processes. I have an application that loads user defined plugins and extensions (some of them are COM based) - I'd like to provide similar functionality (i.e. the ability to change / update an assembly without n...

Initiate Properties automatically using StructureMap

If i have N numbers of classes on each of them i am declaring for example property which contains some app setting values from config file. public static IAppSettings AppSettings { get; set; } I want to populate this property automatically when class is created. I am thinking to achieve this goal using StructureMap. I want to "sa...

Lock Problem in ASP.NET when debugging

I am using lucence.net which creates a file as a 'lock'. From what i can tell it simply creates a file to write to and if it cant the db is locked. I get the exception below I call lucence_init() excepting it to happen once. I call it in Application_Start after i set the current working folder and other stuff. I cant tell when this hap...

Securing asp.net web services to be consumed from flash

Hi, my team is building a game in flash to be embeded in a asp.net application. When the game is over the player have the chance to type his name to save his score. This is done using web services called from flash. The webservice receives the name and score. Since the webservice is publicly available how can I make it only callable fr...

Changing MasterPage control text from ContentPage but still renders old text

Hey guys/girls I have a HyperLink in my MasterPage and i want to change the text of it from a ContentPage. This is how im doing it: In masterpage i included a public property: public string LinkExampleText { set { linkExample.Text = value; } } At the top of my content page, i added the following directive: <%@ MasterType V...