asp.net

ASP.Net AJAX JavaScript Serialization Error

Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code Default.aspx MainScript.js function getObject(){ return new Array(); } function function1(obj){ var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } function function2(){ v...

secure way to authenticate administrator in ASP.NET site using OpenID with DotNetOpenID

Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication. It's a regular WinForms site (not MVC.NET), using the DotNetOpenId library for authentication. Is it safe for me to permit/deny administrative functions on the site by simply comparing the current session's "ClaimedID" (as returned in the Op...

What is the best way to send large batches of emails in ASP.NET?

I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it defaults to 90 seconds) li...

How can I programmatically run the ASP.Net Development Server using C#?

I have ASP.NET web pages for which I want to build automated tests (using WatiN & MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS. ...

SMTP Mail Timeout Issue

When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password. Alright, so I'll display a message indicating that the mail di...

ASP.Net RSS feed

How do I create an rss feed in ASP.Net? Is there anything built in to support it? If not, what third-party tools are available? I'm thinking webforms, not MVC, though I suppose since this isn't a traditional page the difference may be minimal. ...

<asp:RegularExpressionValidator and RegexOptions.IgnorePatternWhitespace

Is there an easy way of using the RegularExpressionValidator control while ignoring white space? I can use a custom validator control with Regex and IgnorePatternWhitespace, but it would be good to just have an option in the RegularExpressionValidator control. ...

AJAX Dropdown Extender Question

Ok, so I got my extender working on a default.aspx page on my website and it looks good. I basically copied and pasted the code for it into a user control control.ascx page. When I do this I completely loose the functionality (just shows the target control label and no dropdown, even upon hover). Is there any reason why it doesn't wor...

ASP.Net UpdatePanel ImageButton causes "this._postbackSettings.async is null or not an object"

I get this error on an update panel within a popupControlExtender which is within a dragPanelExtender. I see that a lot of other people have this issue and have various fixes none of which have worked for me. I would love to hear a logical explanation for why this is occurring and a foolproof way to avoid such issues in the future. I ...

What is the best workaround for the ASP.NET forms authentication timeout problem when using wildcard mapping?

My team is working on a crappy old website and most of the pages are still ASP classic. However, we've recently migrated to forms authentication using ASP.NET and wildcard mapping. Everything works surprisingly well except for one thing: logged in users are timing out too quickly. After looking in the logs it appears people are timing...

Step-By-Step ASP.NET Automated Build/Deploy

Seems like there are so many different ways of automating one's build/deployment that it becomes difficult to parse through all the different scenarios that people support in tutorials on the web. So I wanted to present the question to the stackoverflow crowd ... what would be the best way to set up an automated build and deployment sys...

How should you go about learning ASP.NET after life as a ColdFusion developer?

As someone who has spent around 10 years programming web applications with Adobe's ColdFusion, I have decided to add ASP.NET as a string to my bow. For someone who has spent so long with CF and the underlying Java, ASP.NET seems a little alien to me. How should I go about getting up to speed with ASP.NET so that I can be truly dangerou...

BackgroundWorker thread in asp.net

Hi, Is it possible to use BackGroundWorker thread in asp.net 2.0 for the following scenario, so that the user at the browser's end does not have to wait for long time?? Scenario Browser requests a page, say SendEmails.aspx SendEmails.aspx page creates a BackgroundWorker thread, and supplies the thread with enough context to create and...

When to use HtmlControls vs WebControls

I like HtmlControls because there is no HTML magic going on... the asp source looks similar to what the client sees. I can't argue with the utility of GridView, Repeater, CheckBoxLists, etc, so I use them when I need that functionality. Also, it looks weird to have code that mixes and matches: <asp:Button id='btnOK' runat='server' T...

Finding System.Web.UI.Page from HttpContext

This is actually a two part question. First,does the HttpContext.Current correspond to the current System.UI.Page object? And the second question, which is probably related to the first, is why can't I use the following to see if the current page implements an interface: private IWebBase FindWebBase() { if (HttpContext.Current as I...

Hierarchical Data In ASP.NET MVC

I am trying to come up with the best way to render some hierarchical data in to a nested unordered list using ASP.NET MVC. Does anyone have any tips on how to do this? ...

Excel like server side control for ASP.NET

We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought I'd do a bit of searching nonetheless. I've found a couple ...

Unit testing MVC.net Redirection

How do I Unit Test a MVC redirection? public ActionResult Create(Product product) { _productTask.Save(product); return RedirectToAction("Success"); } public ActionResult Success() { return View(); } Is Ayende's approach still the best way to go, with preview 5: public static voi...

How do I HTML Encode all the output in a web application?

I want to prevent XSS attacks in my web application. I found that HTML Encoding the output can really prevent XSS attacks. Now the problem is that how do I HTML encode every single output in my application? I there a way to automate this? I appreciate answers for JSP, ASP.net and PHP. ...

ASP.NET Custom Controls and "Dynamic" Event Model

OK, I am not sure if the title it completely accurate, open to suggestions! I am in the process of creating an ASP.NET custom control, this is something that is still relatively new to me, so please bear with me. I am thinking about the event model. Since we are not using Web Controls there are no events being fired from buttons, rathe...