asp.net

Closest match for Full Text Search

Hello, I am trying to implement an internal search for my website that can point users in the right direction in case the mistype a word, something like the did you mean : in google search. Does anybody have an idea how such a search can be done? How can we establish the relevance of the word or the phrase we assume the user intended t...

ASP.net: EnableViewState when, why on what control?

Is there any guide/rule on when, why and what server control to enable the view state and when you don't have to? I was looking at this sqldatasource example I notice the label control viewstate is not enable <asp:Label ID="ErrorMessageLabel" EnableViewState="false" runat="server" /> I tho you need to enable the control viewstate in...

Is it possible to map an ID to an unknown type in NHibernate?

Hi, My current project connects to two separate databases almost identical in every respect except for the primary keys. Using NHibernate is it possible to map the ID to some kind of generic type? Primarily my concern is with mapping the ID to an Int64 or Guid. Recompiling the project to make the switch is not a problem, I am aware th...

invalid security certificate and domain names

Hello, I recently purchased a security certificate for a website valid for www.example.com but not for *.example.com (wildcard version - more expensive) The problem i have now is that although users can type http://example.com , the secure version (ssl enabled pages) https://example.com raises the invalid certificate exception - which is...

Dynamically setting CSS values using ASP.NET

I'm working on a site where the images and other resources will be located on a separate domain from the main content of the site. We will use something like 'www.example.com' for the main site, and then 'images.example.com' for all extra resources for styles, etc. When developing the site I will keep all of these resources on local dev...

ASP.NET DataList - defining "columns/rows" when repeating horizontal and using flow layout

Here is my DataList: <asp:DataList id="DataList" Visible="false" RepeatDirection="Horizontal" Width="100%" HorizontalAlign="Justify" RepeatLayout="Flow" runat="server"> [Contents Removed] </asp:DataList> This generates markup that has each item wrapped in a span. From there, I'd like to break each of these spans out into rows ...

How to prevent unauthorized spidering (ASP.NET, IIS)

I want to prevent automated html scraping from one of our sites while not affecting legitimate spidering (googlebot, etc.). Is there something that already exists to accomplish this? Am I even using the correct terminology? EDIT: I'm mainly looking to prevent people that would be doing this maliciously. I.e. they aren't going to abide b...

Why does Visual Studio give you Page_Load for WebForms as a default?

When creating a new WebForm, Visual Studios creates a Page_Load handler in the code behind as a default, which is cool. So for years, I have always put code for doing things like set properties of controls in Page_Load. Recently, I used Reflector to look at some assemblies written by Microsoft and saw that they have put the same type o...

ASP.NET: Can GridView be used to create a hierarchy?

Hi, We are using the GridView controls in some pages of our project which we dont want to change drastically, would it be possible to create a hierarchy in a gridview? Can this be achieved by using a GridView inside a Gridview to get the parent - child relation? ...

View sessions in Visual Studio when debugging a asp.net application.

Is there a way to view ongoing sessions in Visual studio while debugging a asp.net application? And if there is, can you kill the sessions somehow? I need this cause I need to check what, and how to fix, the problems that occurs when a session indeed has died and the user tries to do something that requires the specific session. ...

How do you achieve field level security in ASP.Net?

I have an .aspx form with 20 fields that must be disable based on a users role and a status of a order record. Currently the application has 5 roles and 3 status, so I have 300 different possible conditions that I have to account for. My first thought is to store each permutation in a table, then set the fields when the page loads by ...

Dynamically Loading a UserControl with LoadControl Method (Type, object[])

I'm trying to return the html representation of a user/server control through a page method. It works when I call the overload which takes the virtual path to the user control, but not when I try to call the overload which takes a type. The sample code is below. Any suggestions? [WebMethod] public static string LoadAlternates(string pro...

How do I Dynamically Preselect an item in a html.DropDownlist in ASP.NET MVC

Hi Everyone, is there way thats i can preselect an item when the page loads or posts to the server.. this is what i have right now.. <%=Html.DropDownList("dllMonths", new SelectList(new List<string>() { "", "January", "Feburary", "March", "April", "June", "July", "August", "September", "October", "November", ...

What is the "Temporary ASP.NET Files" folder for?

I've discovered this folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files and have a few questions. What does ASP.NET use this folder for and what sort of files are stored here? How does a file get stored here and when is it updated? Does the folder need any sort of maintenance? ...

Feasibility of ASP.NET based MMOG

Hi, I want to develop ASP.NET C# based MMOG (Massively multiplayer online game). I would be using ASP.NET Ajax control kit, jquery and MS SQL server 2005. Q.1)How feasible .NET 3.5, ASP.NET with C# in handling thousands of users simultaneously. I would also incorporate ASP.NET ajax based chatting system with chat rooms alongside the ...

vs2008 circular references (c#)

Here's the setup I have in a vs2008 solution: Data layer in a project named MyProject.Data Web application in a project named MyProject.Web MyProject.Web has a reference to MyProject.Data In MyProject.Web I have a class I use called "MySite.Utils" I want to be able to use MySite.Utils in MyProject.Data but I can't because it would c...

Generating a lot of static html

I have a process that will need to generate a lot of static html from a set of data. The html is relatively complex and I want the maintenance to be fairly simple so I don't want to embed much if any html in program code. At my company the blessed tool set is .net or php. My initial thought was to embed the asp.net compiler into the ...

Exception that goes away with Clean/Rebuild. How to diagnose/prevent?

Pre-Problem: our office was hit by a worm due to a corporate patching oversight, and the boys in the lab repaved my machine. I needed to re-install all my development tools (Visual Studio 2005, SP1, and the Web Application Project Setup patch) again. The following problem did not occur before this event. I've been working on an ASP.NET ...

Is it possible to write the contents of b.aspx on a.aspx?

Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx is content. I want to display the contents of b.aspx inside a <div> on a.aspx. I know with PHP you can do it like so: //a.php <html> <head> <title>test</title> </head> <body> <?PHP include "b.php"; ?> </body> </html> //b.ph...

Storing Username/Password During Processing

Working inside the context of an ASP.NET application I am creating a page that will be able to execute database scripts against one of many databases in our environment. To do this we need to prompt the user for a username/password combination, this value can be used for all servers without issue. The question is where is the most secu...