.net

Help me to find a better programming approach

Hello SO My application has a set of base classes derived from almost all the UI controls XCombobox,XButton,XMenu etc. All these classes have some additional functionality apart from standard functionality (ex: Serialization capability) I use all these controls in my test windows application. I want to implement a concept similar to t...

What is the default access modifier of a class?

What is the default access modifier of a class? ...

Boxing, a thing of the past?

Is there any point in doing this? public static void Write<T>(T value) { textWriter.Write(value.ToString()); } ...as supposed to this: public static void Write(object value) { textWriter.Write(value.ToString()); } Setting aside the obvious null dereference possibility, If I where to write a lot of value types using this met...

asp.net Is it possible to create a dropdownlist like the one in ms-word fontsize

Hi All, I am creating an application to save the font name, size and color for the entered text to the database. For Color and name i am displaying it from the system font and color. Problem: For the font size i want to make the dropdownlist to act as dropdownlist used for fontsize in ms-word. 1. We can select size already exist in th...

JQuery Beginner Question regarding slide up/down effect

So I tried creating the slide up down effect like in this example http://paulsturgess.co.uk/articles/show/83-jquery-text-slide-up-slide-down-effect The problem is..its showing the text when the web page opens I want the "Paragraph" to be displayed ONLY when mouse is over it and NOT when the page first loads I am a complete noob to Jq...

What is in an MVC application? (Visual Studio 2008/2010)

When you create a new MVC application, how is it different than a Web Application? I can put a route handler in global.asax even in a Web Application. But an MVC application has more than that, it even has the context menu to create controllers and views. I am wondering if it is possible to turn an existing Web Application into an MVC ...

How to tell C# which config file to use?

Possible Duplicate: Reading dll.config (not app.config!) from a plugin module. I have two different projects, say A and B. I need to use some classes of A in B. So I added a reference to A in B. When I tried to run the application, I stated getting Object reference set to null exception. On investigation, I found that when I a...

Sending Mails from Oulook to Other accounts

How to send the email through mine company email id Like every company use to give some email id to its associates like [email protected] How to send the mails through this id to other accounts. Also I don't have passwords for this id, then how to send the email in this situation. ...

Documentation: the <param> shows up in method summary

So I have basically started documenting a class library I made, this is the first time I'm doing a serious documenting (usually only do the <summary>) since it needs more info about some of the parameters used. When I write: ///<summary>Method description.</summary> ///<param name="parameterName">Description of the parameter</param> ...

Method Attribute with param from method?

If it matters, this is in ASP.NET MVC2 - how do I do this - how do I apply the "id" parameter to the attribute? This following syntax obviously does not work :) [AuthorizeProject(ProjectId = id)] public ActionResult Browse(int id) { // Stuff return View(); } ...

What is the fast way of getting an index of an element in an array ?

I was asked this question in an interview. Although the interview was for dot net position, he asked me this question in context to java, because I had mentioned java also in my resume. How to find the index of an element having value X in an array ? I said iterating from the first element till last and checking whether the value is X...

What's the best way of rounding numbers in an ASP.NET GridView bounded to a DataTable?

I have a GridView that is bound to a DataTable, which in turn uses a TableAdapter, like so: ResultTableAdapter tableAdapter = new ResultTableAdapter(); ResultDataTable dataTable= tableAdapter.GetResult(id); gridView.DataSource = dataTable; This gridview displays many columns with numbers in them. Now I have to display the numbers in t...

XML Lambda query in C#

Hi there, I have an XmlDocument object and xml in the format: <?xml version="1.0" encoding="utf-8"?> <S xmlns="http://server.com/DAAPI"&gt; <TIMESTAMP>2010-08-16 17:25:45.633</TIMESTAMP> <MY_GROUP> <GROUP>1 </GROUP> <NAME>Amsterdam</NAME> .... </MY_GROUP> <MY_GROUP> <GROUP>2 </GROUP> ...

How to check if process is not responding?

Is there any possibility to check from code if another process is not responding? The problem is even if the app is crashed and on the Manager's list is marked as 'Not Responding', the Process.Responding property is still returning 'true'. The 'Exited' event and function 'WaitForExit' are do any action if the process is- what is clear-...

Entity framework, LINQ or another framework?

We are working on a large C# 3.5 project that requires a centralized database. The database itself is small both in number of tables and in the size of those tables. Typically, the user will pull information from the database and work on a local copy. My assumption is that the local copy will be in XML but this is not a requirement. In s...

Why is the result of Decimal.MaxValue - 0.5 an integer?

I was playing with decimal today. I noticed this: Decimal.MaxValue 79228162514264337593543950335 Decimal.MaxValue - 0.5m 79228162514264337593543950334 The following code prints true. static void Main(string[] args) { decimal d = Decimal.MaxValue - 0.5M; var b = d % 1 == 0; Console.WriteLi...

Linq to XML, collection is empty!

Hi there, I have an XDocument in the format: <S xmlns="http://server.com/DAAPI"&gt; <TIMESTAMP>2010-08-17 10:14:31.937</TIMESTAMP> <REP_GROUP> <GROUP></GROUP> <NAME></NAME> <LOCAL_NAME></LOCAL_NAME> ........ </REP_GROUP> <REP_GROUP> <GROUP>AMZ </GROUP> .............. Why when I do ...

Using Reactive Extension for certain KeyPress sequences?

I am new .. or more precisely.. never used RX so I was wondering whether I can use it for this situation: I want to add a sort of Resharper Live Templates functionality to my app that allows users to enter short sequences of characters followed by a [Tab] and my app would replace the previously typed characters with the elsewhere specifi...

Accessing Labels in another Webcontrol on the same page

I'm using one Sublayout (Sitecore) and have a placeHolder that currently holds 2 webcontrols. I want to access the Label from one Webcontrol to the other Webcontrol. Do i have to find the Label recursively or can i just access the Label on another way? I tried different methods like: this.Page.Findcontrol this.Parent.Findcontrol etc.. ...

How to create CheckedListBox in DataGridView in winform. Link provided for referece

How to use CheckedListBox control in DataGridView Control in Windows Forms. These are under the namespace. System.Windows.Forms.CheckedListBox and System.Windows.Forms.DataGridView Is it possible. A code snippet will be a great help EDIT I need an help on this link that I found. I hope this might work. But I am more interested on ho...