asp.net

Using a DataContext static variable

I have recently inheited a ASP.Net app using Linq2SQL. Currently It has its DataContext objects declared as static in every page, and i create them the first time i find they are null (singleton, sort of). I need comments if this is good or bad. In situations when I only need to read from the DB and in situations where i need to write a...

Python-getting data from an asp.net AJAX application

Using Python, I'm trying to read the values on http://utahcritseries.com/RawResults.aspx. I can read the page just fine, but am having difficulty changing the value of the year combo box, to view data from other years. How can I read the data for years other than the default of 2002? The page appears to be doing an HTTP Post once the ...

How can I get gzip compression in IIS7 working?

I have installed Static and dynamic compression for IIS7, as well as setting the two web.config values at my application ( Virtual Folder ) level. As I understand it, I don't need to enable compression at the server, or site level anymore, and I can manage it on a per folder basis using my web.config file. I have two settinsg in my .co...

AJAX Control Toolkit: TabContainer inside Multiview, tab button styling problem

I have a TabContainer inside a Multiview. When I bring up a specific editing page that lists records in a Gridview for editing, and then click one of those items... it takes that data from the record selected and populates a form on another View inside the Multiview. That View contains a Tab Container. My problem is that if I come in on...

What is the better way/place for validation ?

In my asp.net mvc application i have service layer, which operated with business object, pass its to repository layer and return to controller. No i can't decide where i need to validate object. First place - use data annotation validation with attribute of component model annotation in business objects class, for example: [AcceptVerbs(...

What are basic ASP.NET form security practices?

Assume I have a form with some disabled checkboxes because the user as logged in shouldn't be able to check them. Where should I add some sanitization security to make sure they didn't hack the checkbox and cause a postback? In the page? Database layer? In the database? I realize it's most likely a pretty broad question. thanks, Mark...

Using ASPNet_Regiis to encrypt custom configuration section - can you do it?

I have a web application with a custom configuration section. That section contains information I'ld like to encrypt (was hoping to use ASPNet_RegIIS rather than do it myself). Web.Config: <?xml version="1.0"?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt; <configSections> <section...

datetime for a asp.net cms

Hi, what things do I have to consider when dealing with datetime in a asp.net web application? I am also using sql server. How can I ensure I don't run into problems with dates? (don't want to release it and THEN deal with it hehe) ...

using viewstate across servers in a farm

with Asp.net 2.0 can a viewstate generated on Server1 be used by server2 in the same farm? ...

Authenticated Webservice with LDAP

I wrote one webservice in ASP.net. I need to authenticate the webservice with the local network userid and password. I am checking this value using LDAP. How can I make this without minimal coding. ...

Using MSBuild to Copy a website into Production while REALLY skipping unchanged files.

I am using MSBuild to Publish a web site, then copy the published site to a web server on the same network. I set the copy command to "SkipUnchangedFiles." It works swimmingly, but Skip Unchanged won't work because when I use AspNetCompiler to publish the website, each and every file is "new" -- its date is set to the moment of publishi...

RPC_E_SERVERFAULT when automating Microsoft Word

I'm creating word documents from templates (.dot) via Microsoft.Office.Interop.Word. The code below works on some templates but not on others: where it doesn't work it throws an RPC_E_SERVERFAULT exception. What is this about, what can be the cause and how could i fix it? (exception occurs at the second line) Code: w...

Does an assembly maintain its directory structure?

Since all files in a web project are compiled into single assembly, then does this assembly maintain a directory structure? For example, if a file in a root directory references a file in a subdirectory, then how could this reference still be valid when the two files get compiled into same assembly? Assume a web project has the directo...

Are JPG, DOC, PDF, etc, files also compiled into an assembly?

Q1: Does aspnet_compiler.exe compile into assembly(ies) all files contained inside the website directory, even JPG, DOC, and PDF types? If you add images to the list of files (thus add them to the project file) in your web project, will these images also get compiled by VS into assembly? Q2: When aspnet_compiler.exe compiles applica...

Nested listview databinding - property not found?

I have a listview, where I set the datasource in the code-behind - this works fine. When I add another listview (or databound control) to the listview's itemtemplate, and set the datasource for that control in the codebehind, the fields returned by the query seem to be unavailable to the nested listview; ASP.NET throws the following erro...

Lose ASP.NET Session for one request and then regains it on next

I am seeing a very strange problem on one of my production boxes. We have an application hosted in IIS 6 on a single machine with an apache web server in front of it. My application is using ASP.NET Membership for authentication and relies on session state. I am seeing a problem right now where some server requests will hit a null exce...

Getting IIS Status Code From an Exception

Greetings! I'm handling exceptions with an HttpModule in a manner such as this: int errorCode = 500; HttpApplication httpApp = (HttpApplication)sender; try { if (httpApp.Server != null) { Exception ex; for (ex = httpApp.Server.GetLastError(); ex != null; ex = ex.InnerException) { try ...

Where does Web.HttpContext.Current.User.Identity.Name come from?

I have FormsAuthentication.SetAuthCookie("someName", True) as part of my custom login sequence. Later, I have some page only allowing a specific role: <location path="myPage.aspx"> <system.web> <authorization> <allow roles="SomeRole"/> <deny users="*"/> </authorization> </system.web> ...

Easy method of exporting an html table to excel file in ASP.NET?

Have a report generated from the DB, want to add an export button so they can get the same report in a excel readable sheet of some type. The key here is ease of implementation so a CSV is fine over XLS if it's easier. ...

How to save all version of a modified file with minimum cost on a database

I recently got database for my website and was suprised to see how expensive it was for the amount of space they gave me (only 500 mb for sql2005). The database is used to store data such as posts or articles submitted by members. the problem: I would like to be able to save not only the final version of a user post, but also all possi...