asp.net

Custom value for the Event Log source property for ASP.NET errors

By default, ASP.NET records all uncaught exceptions to system Event Log. I’m aware of the fact that one should have a proper logging facility in place, but this is better than nothing and it serves well as a temporary solution. I would like to be able to filter efficiently the events in the log. I learned that, when logging programmatic...

How to prevent having to re-login to ASP.NET web apps after a code change

I dislike it when I lose the session state of my ASP.NET web app when changing code. Losing the session state means I have to log in over and over again. It's annoying. Is there anyway I can reconfigure my app so that I can make changes to code and not have to re-authenticate to view those changes? (I know that changing .ASPX files do...

How to implement automatic bug/crash report for ASP.NET web application?

Everyone probably notices that most modern applications nowadays has a way for user to send crash/bug report either automatically or with user permission. Some examples are Mozilla Crash Reporter or most Microsoft applications. I really like this feature since it allows me to collect the bugs report quickly with helpful information tha...

What is the proper way to send an HTTP 404 response from an ASP.NET MVC action?

If given the route: {FeedName}/{ItemPermalink} ex: /Blog/Hello-World If the item doesn't exist, I want to return a 404. What is the right way to do this in ASP.NET MVC? ...

MaskedEditValidator DisplayMoney doesn't show up in Composite Control

I'm creating a simple composite control that has AJAX functionality. When trying to implement a MaskedEditValidator, the DisplayMoney property doesn't work. The MaskedEdit renders, without the dollar sign attached. Any ideas? Here's my code: protected override void OnInit(EventArgs e) { base.OnInit(e); priceTextbox.ID = this.ID ...

How to get Page.ClientScript.RegisterClientScriptInclude to include in the head?

The included script references, in particular jQuery, are being rendered after viewstate. Is there a way to get this in the < head>? Page.ClientScript.RegisterClientScriptInclude("jQuery", "/scripts/jquery.js"); I am trying to register jquery.js in a user control's page load. Thanks in advance! P.S. If it can't be done (with Clien...

using asp.net membership provider how to check if the user is registered or not?

using asp.net and c# membership provider how to check if the user is registered or not? I want to handle this in code not by using "login status"? ...

What's your disaster recovery plan?

And what would you recommend for an ASP Net web application, with a not so large SQL server database (around 10Gb)? I was just wondering, is that a good idea to have an Amazon EC2 instance configured ready to host your app in an emergency? In this scenario, what would be the best approach to keep the database updated (log shipping? man...

ASP.NET MVC Project and the App_Code folder

How come App_Code is not a choices in the Add ASP.NET Folder submenu in the VS solution explorer? I realize you can create one yourself manually by just renaming a New Folder, but what is the rational here? Is this not where you are supposed to put "utility" or "service layer" type classes? On a MVC project side note. I do like the fact...

What are some of the strategy to handle unhandled exception in asp.net mvc applications?

I would like to know some of the strategy/practice you deal with to handle unhandled exceptions in ASP.NET MVC. In short I want to avoid the yellow screen whenever any error happens and show a error consistent error message to the visitor. I mean do you write a controller for this which shows the appropriate error page or you go some o...

Implementing UpdatePanel manually

I was reading an article that shows how bad CodePlex uses UpdatePanels and how nice is StackOverflow on this matter when, for example, a user upvotes an answer/question. I wonder if someone can point a tutorial on how to do such action. I know some points: Create a Web Service that gets the action value and ouputs a JSON string Build...

How to implement PodPress in .NET (just like StackOverflow Blog)

Hi guys, I wonder if anyone has any idea on how to implement the nice and clean UI from PodPress (a Wordpress plugin) into .NET just like you find in the StackOverflow Blog when PodCasts are available. And have that nice stats and iTunes integration as well :) Added: I realized now (stupid of me not checking first - using the meta ...

Designer page not being refreshed when controls are dropped on the form

(Was: ASP.Net codebehind not finding controls on the web page) I'm using VS 2008. I don't know what secret switch I need to flip, or what trip wire I accidentally tripped over, but the last form I created in my project is misbehaving very seriously: the codebehind is apparently unable to find any of the controls that I have set up on t...

UrlRewriting on Global.asax and SQL Output Caching

Hi, I'm performing a UrlRewrite for my main category pages. Converting: www.mysite.com/Category.aspx?id=2 to www.mysite.com/Dogs In order to do so I'm using Global.asax's Application_BeginRequest where I perform the following code(psuedocode): protected void Application_BeginRequest(Object sender, EventArgs e) { if (IsCategoryU...

asp.net webforms and jquery: How to save/restore jquery state between postbacks?

I am building a asp.net webforms (3.5 sp1) application, using jquery where I can to animate the UI, change its state. It has worked great until I started doing postbacks, where the UI obviously resets itself to its initial state. So my question is, what are the best practices for saving and restoring jquery/UI state between postbacks? ...

Mvc Release Candidate "File" ActionResult...

K... I'm doing something obviously wrong. I have a simple page with a file input control on and a submit button. I'm trying out the new "File" ActionResult that was released with the Mvc RC... All, I want to happen is when the submit button is clicked the selected file is uploaded to the database. This all works fine... Then, after the...

Unable to launch the ASP.NET Development server because port '1900' is in use.

I don't know what has got into my computer today. I was developing just fine in VS 2008 and testing my ASP.NET web site on my development server. Then suddenly, out of the blue, I can't run my web site any more! As soon as I hit F5, the message appears: Unable to launch the ASP.NET Development server because port '1900' is in use. An...

How to send value with onclick event?

I have the following button <asp:ImageButton ID="button1" runat="server" ImageUrl="~/image.jpg" CommandName = "id" CommandArgument = "1" onclick="button1_Click" /> and in code behind protected void button1_Click(object sender, ImageClickEventArgs e) { Response.Write(e.commandName); } this does not work!!, So ...

ASP.NET MVC / ASP.NET WebForm data access application - what's the best architecture?

In response to an answer posted by Marc Gravell and his suggestion via email, I was wondering: What choices do people make when deciding on their architecture for a new project? This question could serve as a decent reference point for links/ideas/suggestions/architecture decisions, anything really that is of interest when deciding t...

WebForm_PostBackOptions documentation

Is there any documentation on the parameters to WebForm_PostBackOptions? I can't find anything by Googling. ...