asp.net

Postback with Modified Query String from Dropdown in ASP.NET

My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns). They can select a report using two methods. With SelectedReport=MyReport in the query string, or by selecting it from a dropdown. And it's a common case for them to come t...

IE6 security login (debugging via VirtualPC)

I am debugging my ASP.NET application on my Windows XP box with a virtual directory set up in IIS (5.1). I am also running VirtualPC with XP and IE6 for testing purposes. When I connect to my real machine from the virtual machine, I enter the URL:http://machinename/projectname. I get a security popup to connect to my machine (which I e...

ASP.NET JavaScript Callbacks Without Full PostBacks?

I'm about to start a fairly Ajax heavy feature in my company's application. What I need to do is make an Ajax callback every few minutes a user has been on the page. I don't need to do any DOM updates before, after, or during the callbacks. I don't need any information from the page, just from a site cookie which should always be sen...

ASP.Net AJAX and PageRequestManagerParserErrorException

Has anyone run into this error message before when using a timer on an ASP.Net page to update a datagrid every x seconds? Searching google yielded this blog entry and many more but nothing that seems to apply to me yet. The full text of the error message below: Sys.WebForms.PageRequestManagerParserErrorException: The message recei...

Total row count in Gridview using LinqDataSource and paging

Hello, I'm having a problem obtaining the total row count for items displayed in a Gridview using Paging and with a LinqDataSource as the source of data. I've tried several approaches: protected void GridDataSource_Selected(object sender, LinqDataSourceStatusEventArgs e) { totalLabel.Text = e.TotalRowCount.ToString(); } re...

What is the "best" way to create a thumbnail using ASP.NET?

Story: The user uploads an image that will be added to a photo gallery. As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive. "Best" here is defined as Relatively easy to implement, understand, and maintain Results in a thumb...

Best way to share ASP.NET .ascx controls across different website applications?

Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX controls that you want to share across these 2 applications. What's the best way to create a "user control library", so that you can use the same control implementation in the 2 applications, withuot having to duplicate code? Controls have ASCX with HTML...

In ASP.NET, what are the different ways to inline code in the .aspx?

Can I get a 'when to use' for these and others? <% %> <%# EVAL() %> Thanks ...

How would you handle errors when using jQuery.ajax() ?

When using jQuery's ajax method to submit form data, what is the best way to handle errors? This is an example of what a call might look like: $.ajax({ url: "userCreation.ashx", data: { u:userName, p:password, e:email }, type: "POST", beforeSend: function(){disableSubmitButton();}, complete: function(){enableSubmitBu...

Finding controls that use a certain interface in ASP.NET

Having a heckuva time with this one, though I feel I'm missing something obvious. I have a control that inherits from System.Web.UI.WebControls.Button, and then implements an interface that I have set up. So think... public class Button : System.Web.UI.WebControls.Button, IMyButtonInterface { ... } In the codebehind of a page, I'd lik...

Using Visual Studio 2008 Web Deployment projects - getting an error finding aspnet_merge.exe

I recently upgraded a VS2005 web deployment project to VS2008 - and now I get the following error when building: The specified task executable location "bin\aspnet_merge.exe" is invalid. Here is the source of the error (from the web deployment targets file): <Target Name="AspNetMerge" Condition="'$(UseMerge)' == 'true'" DependsOnTarg...

Creating a UserControl Programmaticly within a repeater?

I have a a repeater that is bound to some data. I bind to the ItemDataBound event, and I am attempting to programmaticly create a UserControl: In a nutshell: void rptrTaskList_ItemDataBound(object sender, RepeaterItemEventArgs e) { CCTask task = (CCTask)e.Item.DataItem; if (task is ExecTask) { ExecTaskControl foo ...

SimpleModal breaks ASP.Net Postbacks

I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their postbacks, which is not really acceptable. There is one source I've found with a workaround, but for the life of me I can't get it to work, mostly because I am not full...

How to Track Queries on a Linq-to-sql DataContext

In the herding code podcast 14 someone mentions that stackoverflow displayed the queries that were executed during a request at the bottom of the page. It sounds like an excellent idea to me. Every time a page loads I want to know what sql statements are executed and also a count of the total number of DB round trips. Does anyone have...

Access files from network share in c# web app

I have a web application that needs to read (and possibly write) files from a network share. I was wondering what the best way to do this would be? I can't give the network service or aspnet accounts access to the network share. I could possibly use impersonation. The network share and the web application are both hosted on the same do...

What does ServerVariables["APPL_MD_PATH"] retreives the metabase path for the Application for the ISAPI DLL mean?

Hello, I've trying to get an ASP.net (v2) app to work in the debugger and keep running into a problem because the value returned by HttpContext.Current.Request.ServerVariables["APPL_MD_PATH"].ToLower() is an empty string. I have found out that this "Retrieves the metabase path for the Application for the ISAPI DLL". Can anybody shed s...

Suppress NTLM dialog box after unauthorized request

In a recent sharepoint project, I implemented an authentication webpart which should replace the NTLM authentication dialog box. It works fine as long as the user provides valid credentials. Whenever the user provides invalid credentials, the NTLM dialog box pops up in Internet Explorer. My javscript code which does the authentication v...

Set ASP.net executionTimeout in code / "refresh" request

Hello. i'll have an ASP.net page that creates some Excel Sheets and sends them to the user. The problem is, sometimes I get Http timeouts, presumably because the Request runs longer than executionTimeout (110 Seconds per default). I just wonder what my options are to prevent this, without wanting to generally increase the executionTime...

How do you do version a Web Application?

What are the strategies for versioning of a web application/ web site? I notice that here in the Beta there is an svn revision number in the footer and thats great for an application that uses svn over one repository. But what if you use externals or a different source control application that versions separate files? It seems eas...

How to keep the browser history in sync when using Ajax?

I'm writing a simple photo album app using ASP.NET Ajax. The app uses async Ajax calls to pre-load the next photo in the album, without changing the URL in the browser. The problem is that when the user clicks the back button in the browser, the app doesn't go back to the previous photo, instead, it navigates to the home page of the app...