asp.net

Windows Authentication for a single file

Environment: IIS 6.0, ASP.NET 3.5 I have the need to secure just one file with windows authentication and just want to ensure that I understand my options correctly. Through IIS turn off anonymous access for the file I want to secure, and make sure Integrated Windows Security is checked Put the file in its own directory and drop a we...

How to set read only flag on streamed content from web server

Is there a way include or suggest a read only flag as part of a content-disposition: attachment; filename=document.doc or other http header? ...

Legacy html form in ASP .net application

I have an html page that I am converting over to an asp .net page. This page contained a form that accesses an external website that I have no control over. There is some sample code below: <asp:Content ID="sample" ContentPlaceHolderID="body" Runat="Server"> <form name="Subscribe" method="post" action="http://anexternalwebsitehere.com/s...

ASP.NET Writing PDF to filesystem

I have a report that I currently allow the user to choose an output option (HTML or PDF) when they are supplying the report parameters (date range, filters, etc.). I want to change the report such that it always does HTML and puts a link on the rendered HTML page so the user can grab the PDF if they want it. How do I modify my IIS6/IIS...

programatically adding and removing events from a GridView

I've got a GridView like below: <asp:GridView ID="Results" runat="server" OnRowDataBound="Results_RowDataBound"> <EmptyDataTemplate>No results found</EmptyDataTemplate> </asp:GridView> Protected Sub Results_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) 'do a bunch of work here End Sub Based upon...

Unable to debug ASP .NET 1.0 Application

When I try to debug a web site in .NET 1.0, I get the following error "Error while trying to run project: Unable to start debugging on the web server. Could not read key from registry" I was not able to find any documentation on this particular error for not not being able to read the key from registry. I did look at Microsoft KB For T...

Parameterized SQL Query error.

I have an application that builds dynamic parameterized SQL queries. The following query returns an inner exception of "syntax error at or near "="... I am thinking it is in the way that I am assigning the parameter to the column name but, I'm not sure. Code follows. SELECT TOP 50 77 AS Repository, DocID, LastFileDate, ImageCount, Lo...

JSP Tutorial for ASP.Net Developer

I am an ASP.Net developer looking to expand my dope skillz to the wonderful world of Java. Strangely, there seem to be a ton of "ASP.Net for the JSP Developer" tutorials, but very few (no?) "JSP for the ASP.Net Developer" tutorials. Just simple things like the difference between the file structures and layout, what webserver to use and h...

How do you persist data from one HTTP module to another and to the eventual handler?

From an HTTP module, is there a way to persist something in the Request to be accessed by a mater module or the eventual handler? Can you "stick" something on the Request as it passes through that will still be there later in the pipeline? ...

Visual Studio Play or Build to compile.

I recently had a problem with the Issue Tracker starter kit that seemed to be resolved by using the "build" option. Previously, I would typically use the "play" button to debug my app, then just stage the files when everything was working, assuming that the last time I hit the "play" button, it had fully compiled the app. Anyhow, I'm...

Session state provider and global.asax not interacting properly?

I'm experimenting with creating a crude, proof-of-concept session state store provider in ASP.Net. But I've got a problem and I'm not sure what to do about it. The website works properly when using the InProc provider. The Session_Start in global.asax is called on session creation as it should. But not if I implement my own provider....

Silverlight and a form application

Hi! I wondering if a can make a form with silverlight like an HTML form and submit its data to a server to store them on a database. Can I do that? Thanks! ...

SqlDataSource SelectCommand using LIKE does not work

I have the following T-SQL in a SelectCommand: SELECT h.Business, hrl.frn FROM registration hrl INNER JOIN holder h on h.call = hrl.call WHERE (h.Business like '%' + @business + '%' and h.Business is not null) and (hrl.frn = @frn and hrl.frn is not null) business and frn are tied to control parameters and it should return data even...

asp.net mvc wizard form with xval

im using linqtosql and xval to validate server side and client side. im trying to do a wizard style form but cant pass the actual values accross different actions. any ideas? ...

Deploying application updates to multiple sites

I have an application consisting of an ASP.NET web application, a couple of Windows services, and a SQL Server 2005 database. This application is replicated at several sites, so that each site has a server containing all parts (web app, services, & DB). Currently the process for deploying updates is this: Database Script database ch...

Is passive logging possible in .NET?

I'm frequently frustrated by the amount of logging I have to include in my code and it leads me to wonder if there's a better way of doing things. I don't know if this has been done or if someone has come up with a better idea but I was wondering is there a way anyone knows of to "inject" a logger into an application such that it passiv...

Is Absolute positioning a best practice or should I avoid it?

I am watching the ASP.NET learn video on http://www.asp.net/learn/3.5-videos/video-13.aspx and it is showing you can place controls on a page using Absolute positioning. I am just wondering if this is a best practice or should I avoid Absolute positioning? It seems like a nice, easy feature, but there must be some reason why it is not ...

Using an AppDomain to instantiate a class in a DLL

I have a website that on user-demand compiles a class on the fly and deposits the dll(named Equation.dll) in a subdirectory of the website. The administrator can recompile at any time. However, once an instance of the class has been created, the message "The process cannot access the file because it is being used by another process" is...

Google Desktop or Indexed Text File Search Within ASP.NET application

I have a folder with thousands of text files and I'd like to paste and search content into a web form and return matches in those files. Is there a way to do content indexing of those files and do these searches from within an ASP.NET application? What tools and techniques are available? ...

What are best practices for validating ASP.Net user controls?

I'm wondering if any best practices exist for guidelines as to what should and should not go into a validator control. My thought and practice was that it should be basic sanity checking (i.e. did the user enter all the required inputs? Is there 10 digits in the phone number, is the email address in the valid form? etc..), but I've recen...