asp.net

UserHostAddress gives wrong IPs

I collect statistics on IP addresses from where users visit my site and I have noticed what there are only two IP addresses presented, 172.16.16.1 and 172.16.16.248. The property I use to determine IP address is Request.UserHostAddress What could be a reason of IP address information losing? All the users are from around the world, so...

Looking for a room booking/hire calendar control for asp.net

Hi all, I'm looking to implement a room booking calendar using ASP.net. Before I go coding the whole thing myself I thought I'd ask to see if anyone knows of any good free or commercial components that do the following. Display a calendar in month view with the ability to colour code specific days to denote full, partial or no availab...

JQuery: Visual studio, error CS1056: Unexpected character '$'

Trying to include ThickBox (from http://jquery.com/demo/thickbox/) in an ASP.NET application. Visual Studio is failing when I try to run the application with the error: js\ThickBox\jquery-1.2.6.min.js(11): error CS1056: Unexpected character '$' Using Visual Studio 2008 and jquery 1.2.6 ...

ASP.NET: Popup browser windows and session cookies

SUMMARY: When browsing an ASP.NET website using Windows Explorer, popup windows do not "borrow" the session cookie from the parent window. DETAILS: I'm working on an ASP.NET website (.NET Framework 2.0). I use FormsAuthentication. It is a requirement to use cookies to handle the session. On a page I have a button. When the user clicks...

When can I delete a file after using it in Response.WriteFile()?

Is the WriteFile call properly synchronous, and can I delete the file written immediately after the call? ...

Why is ASP.NET failing due to permissions on GAC?

I'm trying to run an ASP.NET 2.0 application on an XP machine. As far as I know, everything is configured correctly. However, I receive the following message: Server Application Unavailable And two events appear in the Application event log each time: aspnet_wp.exe (PID: 3352) stopped unexpectedly. Failed to execute the...

How to sync access to file between ASP.NET web site and ASP.NET web service on one web server

I have deployed ASP.NET web site and ASP.NET web service on the same web server. Both of them require access to shared file. How to implement/share lock that supports single writers and multiple readers? If somebody reads, nobody can write, but all still can read. If somebody writes, nobody can read/write. ...

How do I handle exceptions thrown by asmx services?

ASP.NET ASMX service occasionally throws exceptions. However, global.asax Application_Error method do not seem to catch them. The question is, how to configure global error handler to catch and log these exceptions? ...

What factors should effect the Data Access Layer I use on a new project?

I will be teaching a class sson, and I need to explain what factors should affect your decision of data access technology. I am familiar with many data access methods like Typed Data Sets, Linq to SQL, Linq to Entities, .netTiers, LLBLGen, and custom calls with SQL connection objects and command objects. Some of my clients will only all...

Simple way to grab thumbnail of FLV in ASP.NET without changing permissions on server?

I'm looking for a simple way to grab thumbnails of FLVs in ASP.NET, without having to change any permissions/settings on the server. Ideally, nothing is installed on the server machine, but if necessary, small tools such as FFmpeg are fine. I've tried FFmpeg using the command-line tool with Process.Start, but the same command that works...

WCF client consuming multiple asmx service that uses HTTP Cookies

I am trying to use the same http cookie (in effect a asmx sessionid), in multiple WCF client endpoints. The server has several endpoints, one of them is: AuthenticationService.asmx Login() <- Creates a HTTP cookie that is the servers ASP.NET sessionid Logout() <- Destroys the same cookies SomeOtherService.asmx DoSome...

How can I share a folder of content between multiple ASP.Net projects in studio?

I would like to share 2 folders of content ('stylesheets' and 'graphics') between multiple asp.net projects in a solution. Is there a way to do this and have studio display the graphics and such appropriately at design time? ...

Can't find dynamic controls in datagrid on postback

Using .NET 1.1, I have a DataGrid that contains three columns for each row. Row one has a label with some text. Row three will always have two radio buttons and two checkboxes and those are in the HTML side of the page. Row two will have dynamically generated controls (just textboxes for now) and there can be 1 or more per row. These...

ASP.Net AJAX WCF Authentication Services and Session Timeout

Our Web application uses the ASP.Net AJAX Authentication Services to perform login/logout. Everything works great if the login/logout actions are initiated from client side via JavaScript. Question: When the session times out how do I call the AuthenticationService.Logout function from the SessionEnd event? Looking for a simple clean...

ASP.NET Masterpages and viewstate

I am looking to improve the performance of my site, not because it is performing badly but just as a general exercise. The usual suggestion for asp.net sites is to remove viewstate wherever possible. I believe this can be done by each control on a page separately or for the whole page. My question is if I disable the page viewstate will...

Removing CSS Class Attribute From Tag in a Custom Server Control

Greetings! I've created a custom button class to render the following: <span class="btnOrange"> <input type="submit" id="ctl00_MainContent_m_GoBack" value="Back" name="ctl00$MainContent$m_GoBack"/> </span> However, it renders like this instead (note the extraneous "class" attribute in the INPUT tag): <span class="btnOrange"> ...

How do you set ASP.NET Development Web Server to not cache any content?

I use the ASP.NET Development Web server (also known as the Visual Studio Development Web server) to do local web site debugging and testing. I've pretty much found exact functionality with IIS with the dev web server. However - where can you manage the settings of the dev web server - specifically regarding never caching any content -...

Is there a .NET Tool/Add-in available which allows you to easily rearrange the order of Regions, Subs, Functions, and Member Variables in a Class?

I'm looking for a .NET Add-in that reads in the contents of the Current Document window, lists the header declaration of all Regions, Subs, Functions, and Module Level Variables, and provides a simple Move Up/Move Down buttons to rearrange their order. ...

How do I un-escape XML entities easily in .NET

Hi, I have some code which returns InnerXML for a XMLNode. The node can contain just some text (with HTML) or XML. For example: <XMLNode> Here is some &lt;strong&gt;HTML&lt;/strong&gt; <XMLNode> or <XMLNode> <XMLContent>Here is some content</XMLContnet> </XMLNode> if I get the InnerXML for <XmlNode> the HTML tags are ret...

How to audit when a user leaves an ASP.NET app

In ASP.NET, I'm looking for a way to audit a user leaving my application. To be specific, I'd like to insert a 'logout' record in an audit table in SQL Server when the user's session is abandoned/destroyed for any reason (not necessarily because of a call to session.abandon) I have a 'SessionHelper' class that manages the session setter...