.net-3.5

Detecting a users domain in asp.net

If I have a generic public asp.net website, I want to know who is visting my website (I know how to get that), but more importantly, I want to know what company the user is from (is this a microsoft employee viewing my website, or a Coca Cola employee viewing my site or is this person using a home computer to view my site). How can I det...

How do I enter a plus sign ASP.NET Ajax HTMLEditor

I am using Microsofts ASP.NET Ajax HTML editor found here http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/HTMLEditor/HTMLEditor.aspx. When I enter a plus sign '+' into the editor it always gets stripped out and replaced with a space. I even tried using + but that failed to work. Is some way to enter a plus sign into the editor?...

How to detect installed version of MS-Office?

Does anyone know what would be the best way to detect which version of Office is installed? Plus, if there are multiple versions of Office installed, I'd like to know what versions they are. A bonus would be if I can detect the specific version(s) of Excel that is(/are) installed. ...

Why doesn't a LinkButton work with a table as it's content?

Using ASP.NET 3.5, you can create a LinkButton then define content inside of it. It works fine if I have div tags or any kind of text or anything, but if I use a table the click doesn't actually post back for some reason. This should take you to google (you'll get an error there but it should still go) for instance: <asp:LinkButton ID...

WCF Example with TransportWithMessageCredential without proxy class

So I'm using a WCF service using basicHttpBinding with TransportWithMessageCredential. I can authenticate just fine with it from .net to .net. Problem is I want to provide some samples to this third party but everything is encrypted. So I can't just wireshark it and go about my day. var request = (System.Net.HttpWebRequest)System.Net.We...

Create Msbuild CustomTask that can accept sub xml elements or xml attributes (msbuild 3.5)

I would like to create a custom task that is called in a fashion such as this: <Target Name="Remap"> <ItemGroup> <Entry Key="key1" Value="value1" /> <Entry Key="key2" Value="value2" /> </ItemGroup> <CustomTask Entries="@(Entry)" /> </Target> Or this: <Target Name="Remap"> <Item...

why MemberwiseClone defined in System.Object is protected? why it's not public?

I'm wondering why MemberwiseClone is defined as protected. this means that only derived types can access it. what is the problem if it was defined public? ...

"Chat with live agent" popup window drops from the top in asp.net

This one site in particular Total Training Online has a popup window that drops from the top of the screen on the right side. How can I create that in asp.net c# 2008? ...

convert publickey to integer

how will i convert the following public key to integer. these are the RSAKeyValue: Modulus: yf4I7PVef43rZ2NdPFA5FQFb/y/k/5Awqrwc+/VDUimthRg4C5K2P6EUhU5n2m4HUiz102LIuwsYDYuyHwG3VUbAb4zjqxiOwrSpsHfCvgOdLsb4DBrXFFGp5kMtoZrDzl84tnDlyYgy8v3o5Qp2eeQgDaau2PhYUxoco6IArHU= Exponent:AQAB i want to do this bcoz i want to take its xor wi...

Ajax TimerControl and Instance variables?

Hi I've been having an issue trying to write to an instance member of my page class when using the Ajax timer control. I've built a very simple crude example below which emulates the exact problem I'm having... The code below executes a method called "UpdateText" every second using the timer control. Every time the method is called it...

Traversing a list, execute a method: Extension possible?

Hi, i have a data structure like this public class Employee { public string Name { get; set; } public IEnumerable<Employee> Employees { get; private set; } // ... } Now i need to loop through the complete structure and execute a method on each item. How can i create an extension on IEnumerable for such a traverse functio...

Understanding Lambda expressions and delegates

I have been trying to figure this out for quite sometime (reading online blogs and articlaes), but so far unsuccessful. What are delegates? What are Lambda Expressions? Advantages and disadvantages of both? Possible best practice of when to use one or the other? Thanks in advance. ...

The request failed with HTTP status 401: Unauthorized.

I have a .NET2.0 (VB) running in my IIS6 (XP Pro SP2) and a .NET3.5 (configured as .NET2 under IIS's ASP.NET tab, of course) hosting an ASMX web service. In chrome I can call the ASMX invoke the web methods successfully, however in calling the web methods in code, from the .NET2 website I get: The request failed with HTTP status 401: U...

selecting and skipping elements

I am trying to improve some code and I can't think of a better way to do what it currently does. essentially i loop outside for the number of items divided by the number I want to select, then inside that loop I select the item based on an inner loop of the number of items I need to create a single item modifying that by the outerloop va...

Is it possible to nest a listview inside another one?

Using a C# 3.5 Winforms - Is it possible to nest one listview inside another? The idea is to a list of lists - The higher level list would be groupings and the lower level list would be the details. UPDATE: Nesting does not appear to be possible. However using a FlowLayoutPanel I can add many listview controls into it and the panel...

how to fire the event when value is there in textbox when autopostback=true,ontextchanged

Hi Guys, textbox has autopostback=true , and onTextChanged="ShowHours" , i am using textbox and calender datetime picker.when i select a date from picker date is binding to textbox .how to fire the event when value is there? regards kumar ...

Running WCF 3.5 app under .NET 4.0 website

I have a website that is hosted on IIS6 and set to use .NET 4.0, but I still have a WCF service on the site that is using 3.5. When i browse my svc file, i get the error: unrecognized attribute 'targetFramework' and it point to the websites root web.config. I have tried this MSDN article and still get the same error. My site is usi...

Is it possible to align the BackgroundImage of a ListView?

I am assigning an image (star icon) as a background image to my listview in a C# winforms application. listview1.BackgroundImage = Image.FromFile("star.png"); Is it possible to align the image so that it appears somewhere other than the top left-hand corner? ...

Iterate through 2 Lists

I have a List<T1> of items and a second List<T2> of items. Both lists are sorted alphabetically by the property A. I know that the list of items in List<T2> are a subset of List<T1> and no items in List<T2> exists that don't exist in List<T1>. I need to iterate through List<T1> and change a variable every time it matches a variable ...

Identifying properties that override base properties or implement interfaces

I am given: A class "T" which implements properties that are decorated with Attributes that I am interested in. A PropertyInfo "p" representing a property belonging to (1) an interface "I" that T implements, (2) a base class "B" that T inherits from, or (3) the class T itself. I need to get the Attributes defined on (or inherited by)...