asp.net

User authentication database in App_Data folder - isn't that dangerous?

We're planning to use standard ASP.NET user authentication for our application. However, by default this requires us to have our user database on our web server in the App_Data folder. This is usually a big no-no for us - our databases are all behind the firewall and all access is done via a WCF Service layer. If the database was on a ...

How do I get the server/website IP address in asp.net?

When a user request comes in, I can use Context.Request.UserHostAddress to get the user's IP address. How can I get the IP address of the website/server at runtime? I have some reporting code that can be used by multiple websites on the same server, and each website uses a different IP address. So I need to be able to detect the website'...

How stable/usable is SqlRoleProvider & aspnet_regsql?

Hi All, this isn't asp.net specific, some of these apps are WinForms, also will be adding some Wpf and possibly some silverlight apps in the future. I’ve a requirement to put role & permissions based access security into a new app we’re developing here. The .net RoleProviders in general, and SqlRoleProvider in particular seem to have e...

What is the significance of the Type parameter in the RegisterClientScriptBlock method call?

Hi, This is an example of RegisterClientScriptBlock Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "key","scriptblock", True) Why do the method needs the type as the first parameter ? Thanks. ...

ASP.Net 2.0 VB WebSite Project "Type 'Exception' is not defined"

All of a sudden our VB ASP.Net 2.0 WebSite Project started complaining that Exception was not defined. I have discovered that if I add "Imports System" to the header, or explicitly use System.Exception that it works, but this error permeates a lot of other System descendants like the Data namespace, and the DateTime object. We have hun...

How to stop the leading 0's from being stripped off when exporting to excel from a datatable?

I am running into the same problem as in this question: http://stackoverflow.com/questions/22879/how-do-you-prevent-leading-zeros-from-being-stripped-when-importing-an-excel-doc But I am not sure if that is the best solution for my scenario. Here is the code I am using to do the export. Does anyone know what I can change to prevent t...

Where can I find information on code blocks?

Does anyone know a good website that summarises what you can do with code blocks (i.e. <% <%= <%# etc) in ASP.Net? Thanks. ...

How do you structure css files for a web project ?

Hi, In my project I have put all my css classes in the style sheets. The structure I am following was Have a global.css file, which will have all the global styles. And then for each .aspx page one style sheet which will be particular for that file. Although I am talking about the asp.net this should not make any difference to a...

How do I add a Microsoft AJAX auto complete textbox to an existing ASP.NET 3.5 SP1 web application project?

I played with this years ago when it was "atlas". Now I want to use it I assumed it would be a in the VS toolbox. Now all I can find on the web is total confusion! Thanks. ...

How do I get the ASP.NET DataPager control to work in an UpdatePanel?

I have a search page with parameters at the top and a search button with results at the bottom. The entire thing is wrapped in an update panel inside the master page. After clicking the search button it shows the first page. However if you click the next button on the DataPager it does not show the second page. It shows no results fo...

ASP.NET ServerMappath

I have a foler called A and inside A, i have 2 folders B and C, B is having a child folder called child B,now i have a program in C .from C I need to get the PHysical path of childB When i am giving Server.MapPath("../B/childB/") It is showing.Error.Can anybody tell me how to solve this ? ...

Same session with multiple SendActivity activities in WF

Our workflow in Workflow Foundation used to call ASMX web services using the InvokeWebService activity, which has a property SessionId to correlate multiple activities in the same session (by sending the ASP.NET session cookie on every request). It worked. Now we have switched to WCF web service interface, and we have changed our workfl...

Reasons to Use a VM For Development

Background: I work at a start-up company, where one team uses Virtual Machines to connect to a remote server to do their development, and another team (the team I'm on) uses local IIS/SQL Server 2005/Visual Studio installations to conduct work. Team VM is located about 1000 miles from Team Non-VM, and the servers the VMs run off of a...

ASP.NET: WCF and Could not load file or assembly 'App_Web_hamznvwf

I have recently begun working with AJAX-Enabled WCF, and have been plagued with this .NET caching issue - Could not load file or assembly App__Web__hamznvwf I was having issues with this 4 to 5 times a day on my server (Win 2003) - see first post So I moved my files off of the server and started running the project locally (Win XP). Ar...

Debugging w/ Attach to Process Starts ASP.NET Dev Server

I'm developing an ASP.NET site off of my Windows XP IIS Installation, and whenever I tell visual studio to attach-to-process to the aspnet_wp.exe it starts a new instance of asp.net development server. Is there a way to make it not start asp.net development server since I don't need it to launch anything? ...

Hybrid NHibernate DAL/BLL

Hi, I have an existing asp.net webforms project that uses Microsoft's Enterprise DAAB for the DAL, I need to implement some extensive features, and I would like to use NHibernate to make things easier. Is there any design patterns/architectures out there that allow a hybrid DAAB/NHibernate DAL ? is it a good idea ? My thinking is: if ...

Embedded flash video: works locally, but not on staging server

I was able to embed a video that auto plays on my local machine. When I upload my solution onto my staging server I get nothing. It's weird, everything is the same in the code. I am running Vista on my local machine and Windows Server 2003 on my server. Does someone with a little more experience in this feel like pointing me in the...

How to add node into TreeView Control with Javascript

Hi guys, I just wanna learn how to add a node to TreeView control (which takes its data from database with a parent-child relationship). Of course when I select a node the new node I wanna add should be added under the selected one and after adding it into the selected node then I wanna add the new node into database too. I can handle t...

Is MVC the best way to code asp.net applications?

update: I know there is no one best way to do everything. Sorry for not saying that right off. In the context of the data-access tutorials, if you had to do the project he did in that tutorial, would you do what he did or would use use MVC, if you had to choose one of them? Thanks. update: Is MVC the more approriate way to program a...

Custom PageHandlerFactory for .aspx

Hello there, I am building a fairly simple CMS. I need to intercept requests for the majority of .aspx pages in my web application, in order to gain complete control over the output. In most cases, the output will be pulled from cache and will just be plain HTML. However, there still are a couple of pages that I am going to need to u...