asp.net

Convert Web.config from .NET 2.0 to 3.5

What is the minimum I need to add to a .NET 2.0 WebSite's web.config to make it .NET 3.5? Visual Studio adds all the config sections and script handlers, but if you aren't using those are they are really necessary? Is there a command line tool to "upgrade" a .NET 2.0 web.config to 3.5? ...

VS2008: Copy Web Site from command line

How do I execute the "Copy Web Site" command for an ASP.NET project in VS2008 from the command line? If I need to script this, let me have some pointers on where I can learn that. ...

How to hide the cancel button on an ASP.NET ChangePassword control

I'm considering using the ChangePassword control on an ASP.NET 2.0 Webform. I don't want the 'cancel' button to show. Is there a good way to hide it without resorting to silly "width = 0" sort of games? Or perhaps there's a generic way to walk through the parts of a composite control like this and hide individual parts? ...

Updating/Intercepting HttpContext.Current.Request.QueryString

Here's a wierd one. I'm reusing a code base that unfortunately, must not be updated. This code makes a call to HttpContext.Current.Request.QueryString. Ideally, I need to push a value into this collection with every request that is made. Is this possible - perhaps in an HTTP Module? ...

How to make user controls know about css classes in ASP.NET

Since there are no header sections for user controls in asp.net, user controls have no way of knowing about stylesheet files. So css classes in the user controls are not recognized by visual studio and produces warnings. How can I make a user control know that it will relate to a css class, so if it is warning me about a non-existing css...

Send email from Elmah?

Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification so we can react more quickly to exceptions. Here is my web.config (unnecessary sectionss ...

Setting a form's action in .net 3.5 SP1 causes errors when compiled

I have recently installed .net 3.5 SP1. When I deployed a compiled web site that contained a form with its action set: <form id="theForm" runat="server" action="post.aspx"> I received this error. Method not found: 'Void System.Web.UI.HtmlControls.HtmlForm.set_Action(System.String)'. If a fellow developer who has not installed SP1 dep...

Entire Page refreshes even though gridview is in an update panel

I have a gridview that is within an updatepanel for a modal popup I have on a page. The issue is that the entire page refreshes every time I click an imagebutton that is within my gridview. This causes my entire page to load and since I have grayed out the rest of the page so that the user cannot click on it this is very annoying. Does ...

Is there a built in way in .Net AJAX to manually serialize an object to a JSON string?

I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on the fly with the <System.Web.Services.WebMethod()> and <System.Web.Script.Services.ScriptMethod()> attributes so there must be a built-in way that I'm missing. ...

requiredfield validator is preventing another form from submitting

I have a page with many forms in panels and usercontrols, and a requiredfield validator I just added to one form is preventing all of my other forms from submitting. what's the rule that I'm not following? ...

Would building an application using a Sql Server Database File (mdf) be a terrible idea?

I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules. I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just doesn't get the job...

Bypass Forms Authentication auto redirect to login, How to?

I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually when a user tries to access a resource without proper authorization I want them to be redirected to a login page. FormsAuth does this for me easy enough. Problem: Now I have an action being accessed by a console app. Whats the quickest way to...

Exception in Web Service locks DLL and prevents publishing. Workaround?

I'm using a native DLL (FastImage.dll) in a C# ASP.NET Web Service that sometimes locks (can't delete it---says access denied); this requires stopping IIS to delete the DLL. The inability to delete this DLL in the bin folder of my published Web Service prevents me from publishing successfully (even though it thinks it published successfu...

ASP.NET MVC Route Help, 2 routes, 1 with a category url structure and the other for content page

Hi, I need some help with ASP.NET MVC routes. I need to create 2 routes for a cms type application. One route will be for category level URLS, and the other route will be for the actual page content. categories, always ends in a '/' www.example.com/category/ www.example.com/category/subcategory/ www.example.com/category/subcateg...

FileUpload control inside an UpdatePanel without refreshing the whole page?

According to Microsoft the FileUpload control is not compatible with an AJAX UpdatePanel. I am aware that a PostBackTrigger can be added to the submit button of the form like this: <Triggers> <asp:PostBackTrigger ControlID="Button1" /> </Triggers> The problem is that this forces the form to perform a full post-back which voids out...

How to assign a method's output to a textbox value without code behind

How do I assign a method's output to a textbox value without code behind? <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <script runat="server"> Public TextFromString As String = "test text test text" Public TextFromMethod As ...

Relative Root with Visual Studio ASP.NET debugger

I am working on an ASP.NET project which is physically located at C:\Projects\MyStuff\WebSite2. When I run the app with the Visual Studio debugger it seems that the built in web server considers "C:\Projects\MyStuff\" to be the relative root, not "C:\Projects\MyStuff\WebSite2". Is there a web.config setting or something that will allow t...

Long-term Static Page Caching

I maintain several client sites that have no dynamic data whatsoever, everything is static asp.net with c#. Are there any pitfalls to caching the entire page for extreme periods of time, like a week? Kibbee, We use a couple controls on the sites (ad rotator, some of the ajax extensions) on the sites. They could probably be completely w...

Listing Items and Displaying Data Inline

I use asp.net 3.5 and have also begun looking at 3.5 sp1 I like the clean urls that mvc tends to have but use asp.net webforms for my primary development. I normally use a url rewriter in order to accomplish this type stuff. When I say clean urls I mean like /products to get a list of products and /products/Product_One to look at the in...

Redirecting users from edit page back to calling page

I am working on a project management web application. The user has a variety of ways to display a list of tasks. When viewing a list page, they click on task and are redirected to the task edit page. Since they are coming from a variety of ways, I am just curious as to the best way to redirect the user back to the calling page. I h...