.net

How to create a fading banner like with SO's badges?

Using .NET, mootools/JavaScript. I want to create a trophy mechanism similar to SO's badges. So when a user recieves a trophy, a small fading DIV will appear at the top of his page. Problem is, I need to keep checking against my DB if the user recieved a new trophy or not. How would you approach it? Would love to get code samples if yo...

Is this code threadsafe or why am I concern with Url.Helper

Say that I have public static class M { public static string Concat(string a, string b) { return N.AddOne(a, b); } public static string Concat2(string a, string b) { return SomeThreadSafeMethod(a, b); } } public static class N { public static string AddOne(string a, string b) { retur...

I need (horizontal) scrollable list of templated panels !

So ... for example I've got some template - panel with edits and data from an object And now I've got dynamic count of objects and I need dynamic count of panels somewhere :-/ I'm interested in any ideas if there any way to make this frame on WinForms. ...

.NET C# Reset Password - Random!

Hi, I have done the usual Google searches and I think I am correct in saying there is no random password generator in the .NET Framework. The intentions are to reset passwords in AD for forgetful users. This is bound to be an issue in the next stage of penetration testing. I want to avoid the response "oh yeah, I just knocked up my own...

disable usercontrol

How to disable a usercontrol so that the Page_Load is not executed ? Enabled doesn't exist for a usercontrol and Visible doesn't work, it just hide the usercontrol , but the page load is executed. ...

Custom glyph on DataGridView Header

Hello, I have a DataGridView where I would like drawing custom glyph (let's suppose a triangle) on the column header when the user click on it. I have the property EnableHeadersVisualStyles set to False. Do you have any example or suggestions how to reach the desired result? Do I need to inherit from DataGridView, or DataGridViewColu...

What is the best way to secure a webservice?

Hi, As the title allready explains I want to secure my webservice. I've read that you can do this using an soap authentication header, but then the username en password are passed as plain text. I was wondering what I should do to secure my webservice? Examples would be great. I have an example of a company we work with that has 2 web...

Programmatically access GridView columns and manipulate.

I have a GridView : <asp:GridView ID="GridView1" runat="server" AllowPaging="True" GridLines="None" HorizontalAlign="Left" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" onrowcommand="GridView1_RowCommand1"> <HeaderStyle HorizontalAlign="Left" /> ...

How to display a Windows Form in full screen on top of the taskbar?

I have a .net windows application that needs to run in full screen. When the application starts however the taskbar is shown on top of the main form and it only disappears when activating the form by clicking on it or using ALT-TAB. The form's current properties are as follow: WindowsState=Normal TopMost=Normal Size=1024,768 (thi...

c# Regex.Match problem

I am having some issues with matching text to extract data from an HTML page. Here is what I have so far, but plainText stays empty: private void Scrape() { // create variables string html; string plainText; // download page source // sample URL: http://freekeywords.wordtracker.com/?seed=test&amp;adult_filter=remove_offensive...

Does Foreach Item in LinkedList give items in order?

Does Foreach Item in LinkedList give items in strict order? Is the strict order First=>Next=>Next=>...=>Last respected in foreach or maybe is better to use while (item != null) ... item = item.Next? ...

Avoid signed assembly network access

I'm using a .net assembly that was digitally signed (using comodo), and I noticed that the first time my application loads the assembly it connects to 'ocsp.usertrust.com' and 'crl.comodoca.com'. Is there a way to avoid these connections? ...

ApplyCurrentValues in EF 4

I just was playing with EF 4 in VS 2010 RC and just found that ApplyCurrentValues dont work when the Property is of type bool and the newly value is false !!!??? and it works when the newly value is true . I dont know if this is a bug or I'm missing something but I just work with a very ugly work around : public void UpdateProduct(...

How to convert a generic List<T> to an Inerface based List<T>

I am sure I am missing something simple, however I am trying to convert a strongly typed list of objects that all implement an interface in to a list of that interface type. Below is a sample to demonstrate the error: public void ExampleCode(){ List<Cube> cubes = new List<Cube>(); List<Shape> allShapes; allShapes = cubes;/...

Correctly Identify the sender of a chat message in ASP.NET

I am developing a chat application using VB.NET and ASP.NET and I need to identify the particular user name users post messages. At present, it just shows my name, even for messages I haven't posted. What am I doing wrong? ...

How to read CDATA XML Content

I have the following xml file: <?xml version="1.0" encoding="utf-8"?> <root> <phrase id="test"><![CDATA[test]]></phrase> <phrase id="test0"><![CDATA[test0]]></phrase> <phrase id="test2"><![CDATA[test2]]></phrase> <phrase id="test3">test3</phrase> <phrase id="test4"> <![CDATA[test4 LINEBREAK]]> </phrase> <phrase id="test5"> LINEB...

Master Data Management - Data redundance

Hi all, I am currently developing a system that holds all relevant master data like for example a customer, or information about an operational system that exists within our system landscape. The assigned IDs to these entities are unique within the enterprise. When some system stores e.g. customer related data, it has to hold the maste...

Create an object whose type is in a string parameter

I have a TreeView, which contains nodes. When a user clicks on a node, corresponding CrystalReport document should be created and displayed. For example, names of my nodes are: "PeriodReport1", "PeriodReport2", "PeriodReport3". My CrystalReport documents are named same: "PeriodReport1", "PeriodReport2", "PeriodReport3". How can I creat...

DataGridview repaints very slowly

I'm using datagridview in windows application developed in C# VS2005 .net 2.0. Datagridview is provided a list of business objects. It take annoying delay of 2-3 seconds before starting displaying the rows in datagridview in falling-curtain fashion. When I switch back to my application from any other window it start repaint process in t...

Localization .NET; Fallback language when using ResourceManager

Recently I was delving into Localization with .NET. Essentially, I learnt how to customize a form (using the Language and Localizable property) and then change the culture accordingly. However, I found that when migrating my hard coded English strings into the auto-generated resource files, and use .GetString("Key") -- well, let's just ...