asp.net

Reference one inline class from another.

Guys, I’m having difficulty referencing one main VB file from a new vb file. Here's the problem - the code file is ancient, and runs on ASP.NET 1.1. It runs without being compiled to a DLL, and changes regularly. for that reason, I'd rather not compile either New Person or Old Person to a DLL. A default page look something like this....

How can I control the order that emails are sent from an ASP.NET application

Hi I am trying to control the order that emails are sent from a web site. I have code that sends email1 and email2 using the same mechanism : System.Net.Mail.SmtpClient. The emails always arrive in the order email2, email1 (even if I send them email2 and email1). I have tried setting the timeout properties as suggested here http://fo...

Configuring ASP.NET Development Server to connect to a postgres database

I have an existing ASP.NET app which is configured to connect to a MS SQL Server database and I am trying to modify it to use a postgres database instead. I would like to avoid modifying the C# code, if possible. I expected that the following changes would be sufficient: Add a reference to a suitable postgres driver, in this case Nau...

Sorting a ListBox bound to an ObjectDataSource using a dropdown with 2 selections

I am having an issue on Sorting a ListBox with a dropdown. The dropdown will have 2 options: Sort By # Sort By Type The ListBox contains a list of items which are initially ordered in ascending order by #. It has the following format: 1: Red 2: Green 3: Blue 4: Red 5: Red If the user choses Sort By #, it should sort in descendi...

ASP.NET: generate property value when adding control to page

Context: ASP.NET 3.5 / C# Hi, I created a user control public partial class MyControl : UserControl { // EDIT: example first used "UniqueId" as property name, which was wrong. public Guid MyId { get; set; } // ... } and this example usage <uc1:MyControl ID="myControl" MyId="443CBF34-F75F-11DD-BE2F-68C555D89123...

Sharing authentication between IIS applications on same domain

Hi, I have an IIS website on www.example.com and a virtual directory at www.example.com/demo/ How can I use the authentication cookie from www.example.com in my virtual directory? ...

Validation of a validation expression

...

How to get a regular expression to match items with spaces

The following regular expression works if there is no space character, but if the input has a space character, it doesn't work (it seems like a link but JavaScript doesn't work). How can I change it? The regular expression should work for both World and The World. Dim makebkz As String Dim pattern As String = "\(bkz: ([a-z0-9...

Is it one-to-one or Component ? Nhibernate Mapping

Assume that I have Person and Address Classes and they have different tables in DB. One Person can have one Address Class in it. This is the important part for me. One Person can have only one Address as it s child element and i want to keep them in different tables in DB. Normally i know that i need to hold them in the same table, but...

Can I use ASP.NET MVC together with regular ASP.NET Web forms

I have on request from a client built a huge site with ASP.NET Web forms. The problem is that I'm finding ASP.NET Web forms to be somewhat unintuitive (my personal taste only). So what I would like to do is use MVC but I can't really expect my client to pay for my time on a complete rewrite (nor do he have the time). So what I'm asking...

How can I sort a List<T> when the user clicks on a table header?

I'm writing an asp.net mvc app and I've get a list of service calls that I display in a table. When the user clicks the table header I want to tell my controller to sort the list by that column. public ActionResult Index(int? page, string sortBy, string sortDirection) { int pageIndex = page == null ? 0 : (int)page - 1; ...

SelectedIndexChanged event does not fire if Item is already selected in dropdown?

Assume that I have a dropdown with 2 items and by default, the first item is selected. If I select the click the first item in the dropdown, is there a way I can get the selectedIndexChanged event to still fire? Can I do it by setting the SelectedIndex of the Dropdown to -1, for example? Well that didn't work, lol, because it does not...

Create a cache dependancy on a folder and its sub-folder

In ASP.NET I would like to store an object in the cache which has a dependancy on all the files in specific folder and its sub-folders. Just adding the object with a dependancy on the root folder doesn't work. Is there in any reasonable way to do this other than creating a chain of dependancies on all the files? ...

Sys.Application.add_load Problem with Modal popup extender

Hello everyone, I have the current problem, let's explain the context before : I have a Modal popup extender who contains a form. There is a feature "Save and Add New", when the user click on this button the data in the form is saved in the database during postback and the page is reloaded. I want this Modal popup to appear again on ...

Using GridView HyperLinkField to set a CategoryID

Hello, I am using asp.net and I'm working with a gridview. I have one of the fields in my GridView set up as a HyperLinkField that represents the name of the category. I pull the name and Id from a database and I can never be sure what they are because they are added separately. I want to be able to pass a changing CategoryId to another...

Need help in Login code in asp .net

Hello all, Somebody please help me by modifying this code.In my login page i have three column Login,UserName,Password.In Login i have kept dropdownlist with two list item Admin and User.So when i Select Admin,UserName,Password it should go to desired destination page and when i select User,UserName,Password it should go to another des...

asp.net ajax updatepanel and playing sound

I want to play a sound when asp.net updatepanel updates. Is there a free and simple way to play sound when ajax panel updates? ...

Disabling ASP.NET EventValidation

We're tired of getting exceptions regarding "Invalid postback or callback argument" in our web app. What scenario(s) causes this error? After talking to users, we've determined that one possible cause of this is when they click something that causes a postback, and then click something else before the initial postback completes. What ...

Webpart Connections asp.net VB

Hi, Im having the following problem with vb.net asp.net webparts. Im trying to create a static connection between webparts but im running into a problem, namely: Could not find the connection provider Web Part with ID 'Ucl_Diary_Summary1' I have the following defined as my iterface: Public Interface IDiaryPartsProvider func...

Preventing webform resubmission on browser refresh without losing viewstate

Duplicate: http://stackoverflow.com/questions/305684/how-can-i-prevent-database-being-written-to-again-when-the-browser-does-a-reload Is there a nice elegant way to stop an .aspx page from resubmitting form data if the user requests a refresh from their browser? Ideally without losing the viewstate. EDIT: The most elegant solution f...