.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Add item at specific position on IDictionnary

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net


I would like to insert an item at a specific position using IDictionnary !!! this code does not compile


 public class Product : DictionaryBase
        public Product this[int index]
                return ((Product)(Dictionary[index]));
                Dictionary[index] = value;

        public bool Contains(Product product)
            return Dictionary.Contains(product);

        public int Add(Product Product)
            return Dictionary.Add(Product);

        public void Insert(int index, Product product)
            Dictionary.Insert(index, product);

        public void Remove(Product product)


View Complete Post

More Related Resource Links

new Item form assigned to a specific user

hi, i want to create an absence request form with the new item form. and when the user fill in the form he can't choose for whom he will send it for approval the form is automatically set to be send to a specific approver.   thnx

Create buttons for "new item" which create a new page of a specific content type

We have a Pages library (wiki) which supports a few content types (and page layout associated). We want to enable users to click a button for example of "new custom enterprise wiki page" - so a new page of content type article will be open in edit mode. Can someone help how to develop? (it has to mimic the behavior that happens when user creates new page from the Ribbon or Site actions and has to choose the content type, it also has to keep the new page in edit mode and not just create it).  

Repeat specific item in ItemStyle.xsl

Hi , from some days I am working with one of great and powerful SharePoint Publishing Web Part , 'Summary Links' what I am trying to do is , repeat specifc <li> tag for each Summary Link Item I know how this can be done for ContentQuery WebPart which uses same ItemStyle.xsl , but when we work with ContentQueryWebPart , that references to ContentQueryMain.xsl and we have / we can define lots of param there so I was wondering how we can do same (repeating specific item) using SummaryLink web part? do we need to change something in SummaryLinkMain.xsl?Warm Regards, Bhushan http://www.passionatetechie.blogspot.com

How to set a Accordion Expander Icon to a specific position at the AccordionItem




i would like to know, if its posible to set the expander "icon" ( > ) of a AccordionItem to a specific position at the AccordionItem ?

Ans how can i solve that ?


thanks for any help

List Item is not visible to specific users in a webpart in my portal



There is a webpart which is displaying the items from list.There is another webpart which also display same items as in the above webpart.

Issue: Now the issue I am facing that the list items are not visible to specific users even though it is visible to same users who are in the same group. But this issue I am facing in production environment but not in staging environment.

Your quick help will help us a lot.



Grouping/Expanding specific item


Let's say I have a report and the main detail item is FamilyName.  It displays values such as this:





If I want to show a plus and expand ONLY smith, so I could see that the family contains "Bob, Sue, Billy, Mary...", how would I do something like this?

Thanks in advance.


Site Analytics - how get specific list item id to display in Top Page Results

We have created a new Site to store Knowledgebase Articles. The articles are being added as items in the list. We now want to find which are the most viewed items. When I look at Site Analytics, I find several pages being returned including what I believe are the Items viewed. When I look at the details under the graph or when exported to Excel, this the is extent of the Page URL (/lists/kbarticles/dispform.aspx?...). There are several occurances of this same URl which I expect are separate items that have been viewed. How do I get the ID of the item or other information, so I can track it to the specific Knowledgebase Article? Additional information: I can click on the URl and it will take me to the unique Knowledgebase Article. 

How to position one control relative to another one even after resizing windows?


I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

Button specific code


I have 2 submit buttons on my page. Right now, the only way to run the code behind with razor is to to If(IsPost). Since I have 2 buttons, how would I destinguish between the two in post? Is there a way to request a button that sent a post request?  

removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







LINQ to SQL - Validating if item is in Database, but if item is not items not inserting into databas



I am new to this, so bear with me.  I am writing an application in C# that uses LINQ to validate a datacontext off a textbox to see if the record exists already.  If the record does exist I inserted an if statement to advise the user that the record exists, if the record does not exist I would like to allow the record to be added to the database.  If I take out my else statement everything works fine as far as inserting goes, but I do not want to allow inserts in this scenario.  I have tried moving the if and else statement to different parts of the code but can't quite figure this one out.  Any help would be apprecaited, attached is the code.  This code is set to a button press.  As a matter of fact, if you see any other errors along the way please feel free to point them out. 



    protected void enterBTN_Click(object sender, EventArgs e)
        //make new data context

        SHCDataContext insNewAll = new SHCDataContext();
        //LINQ to check if customer exists in database
        var checkExisting = from c in insNewAll.Customers
                            where c.custLastName.Contains(custLastNameTB.Text.ToString())
                            select c.custLastName;
        //make list to store values

Getting list of users reporting from specific Manager from Active Directory


Dear All,

I am have requirement like displaying all the user information reporting to specific manager from Active Directory.

Please help me regarding this.



Create web site specific to mobile device, how to detect?



I have a website that is written in .Net 2.0 which uses all the nice rich functionality of the web (Ajax, javascript etc..).  However I have noticed that the site does not display very well on mobile devices. 

So therefore I would like to create a more streamlined version of my site that is better tailored to these devices.  However how do detect that the user has come to the site via a mobile device and how can i redirect them to my tailored page

Many thanks in advance

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

Patterns in Practice: Internal Domain Specific Languages


Jeremy Miller explains how internal Domain Specific Languages can help you craft code that is easier to read and write. His bag of tricks to improve your programming includes extension methods, fluent interfaces, object extensions and use of the semantic model.

Jeremy Miller

MSDN Magazine January 2010

Team System: Work Item Tracking


In this column, Brian Randell explains how to build a simple Work Item explorer and demonstrates the core operations needed to add work item support when building your own add-in.

Brian A. Randell

MSDN Magazine April 2007

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend