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

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

proper pattern for list of reusable controls

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :ASP.Net

Say you have a for loop which renders a bunch of the exact same control.  This is probably done with RenderAction or RenderPartial.

What is a way to ensure that each of these controls in the list gets wrapped in a div with a unique ID?


View Complete Post

More Related Resource Links

how to hide/display controls in NewForm.aspx based on dropdown value in SharePoint list



I have 1 dropdown in my sharepoint list with other columns. If dropdown value equal to 'xyz' i need to display some other controls, otherwise these controls should be hidden.

I know we can achieve this with javascript. If any one can provide code or sample then it will be appreciated. or is there any other alternative methods to do this ........

Thanks & Regards, Neerubee

Problem with list controls and update progress template



I have an update panel that surrounds a wizard control which I use in conjunction with a update progress control. Now my update progress control works perfectly, with my animated gif and div tag that lays over my wizard control when the user goes from step to step. However, there is a problem that I am struggling to solve. A number of my steps use controls like list boxes, and when the update progress control fires, the list control is not laying underneath my div an animated gif no matter how high a make my css z-index on the div.

Does anyone have a way of solving this?


change focus on controls in sharepoint list newform.aspx

hi all. i have newform.aspx where i hav required fields . when i say ok to enter the values the required field valiedates and shows error messages. but the problem is that the focus where it is suppose to get placed is promting in differnet place. can i change the focus of the controls inside newform.aspx or editform.aspx?jayaraja

Assigning a reusable workflow to all content types in a list in one operation?

When creating a reusable workflow I choose a base content type. I would really like to assign this workflow to the content type at site collection top level and get it to automatically work in all lists that include this content type, and also have it set to work for all children of this top level content type. It seems to me that I have to manually associate this workflow to all lists and content types? I am missing something here? Henning

Using LINQ to Get Filtered List of Controls


I have zero experience with LINQ but had occasion to use it today.  I implemented a working solution but do have a question.

First, let me provide the background:

I have 20 large web pages that altogether have several hundred data input controls on them.  There are strong similarities between how each type of control is handled.  Rather than wire up each control individually (ie. hard code it in the layout page), I thought it would be a lot easier to just do so dynamically through a common method.  On each of these web pages there's a MultiView control, inside of which are 2+ View controls.  The guts of my original version of the common method looked like this:

      foreach (View view in multiView.Controls)
        foreach (Control ctrl in view.Controls)
          switch (ctrl.GetType().Name)
            case "DropDownList":
              DropDownList ddList = (DropDownList)ctrl;

Multiple issues with dropdown list controls not working correctly


I am using WSS 3.0 and SharePoint Designer.  I have modified one of the items in my NewForm page so that I have a filtered lookup using a spdatasource. The filter works great, but my issue is that I can't seem to save the users selection back to the list itself.

Issue when using an ASP.NET dropdown list
I am able to bind the filtered spdatasource to an ASP.NET dropdown list control, however the item that is selected in the dropdown list is not being saved back to the list.  I am guessing that this is because the dropdown list itself is not tied directly to the appropriate list item, but... I can't seem to figure out how or where to do this.  I don't see anything in the data properties box in SharePoint Designer that allows me to tie the data back to the list itself.  Maybe I am just overlooking it somewhere?

Issue when using the native SharePoint Data View DropDownList with a filtered spdatasource
When I select "Data Fields..." on the dropdown control I get the Change Data Bindings dialog box.  From here I can select a data field to save the value back to (which resolves the issue noted for the asp.net control) and I can select my spdatasource, but... the display text and value fields below that never populate.  Thus, the dropdown list is empty when the user is filling ou

MVP Pattern : how user controls communicate with each other on the same aspx page



I have 2 usercontrols: ucc1 and ucc2. ucc2 's data is dependent on the data selection in ucc1. How would i implement this with MVP pattern or I should handle it thru the main page by reading the data in ucc1 and set it to ucc2?

Thank you


Adding windows forms controls to the display of list items



I'm new to Sharepoint development, and was wondering if I could get some brief pointers to get me going in the right direction.  I'm required to add a button to list items that on submit does some manipulation of the data in the fields inside the item and then sends that data off to an external webservice.  The complexity is sufficient to warrant managed code, i.e. C#.

What I'd like to know is how to approach integrating this code into Sharepoint.  I've read about web parts, but viewing list items doesn't involve web part pages on my installation so I can't include my own.  What other ways are there of doing this?

Cheers all

Invalid postback or callback argument (using Cascading dropdown list controls)



i use cascading dropdown lists (in a user registration form) and when the user hits the submit button i get the error:

"Invalid postback or callback argument"


I've seen on the net that this is a problem dating back many years but still haven't found a solution to this.

 I've read about changing EnableEventValidation to false, but this poses a security risk.


Anyone knows a good solution to this? (i'm coding in c#)




how to validate a "Custom List" or "Picture Library" controls?



For validating "Custom List" or "Picture Library" controls i followed the follwing link


after adding asp.net regularexpression validator control for alphanumeric validation. it is not working.

if it is proper also the validation error message doesn't disappear. any other way to fix this issue?

Thanks in advance..


controls list in toolbox disabled


I just upgraded from 3.5 to 4.0 and downloaded and installed the AJAX toolkit to my toolbox. However, all the controls in the AJAX list (and other "non-standard" lists also, such as Silverlight and Form controls) are disabled. What to do?

How to create a dynamic list of checkbox controls in Infopath


I am relatively new to sharepoint, and since I do not yet have a proper development environment in my current contract, I have had to attempt to produce solutions to various line of business problems using Nintex and Infopath alone.  They are working on getting one created for me but i still can't believe microsoft make you purchase a whole other sharepoint server licence unless you think developing directly on the live server is a good idea, but I digress, thats not the issue I need assistance with.

The current issue I am trying to find a solution for, or atleast the right way to approach, is the creation of a simple form where the user can check off a register of daily tasks completed and submit the form back to sharepoint from a tablet PC.  Each submission is to create a new entry in the DailyRegister list with a handful of other fields like who, where, when, etc.

That is the easy part that I was able to produce with relative ease, but where it gets tricky is they want the list of tasks to be dynamic. 

i.e. A separate sharepoint list that will just hold the list of currently relevant tasks to be included in the form for that day.  Effectively using a 3rd list as the relational reference table between the DailyRegister list and the AvailableTasks list.

I am planning to create the AvailableTasks list to look something like:

Proper directory layout for reusable components...



In the application that I am reorganizing, I have a bunch of custom brushes, borders, custom controls, etc. I am trying to understand what is the best way to organize them for reusability as well as maintainibility.

Here is what I am thinking:

1. Have all the reusable components in a class library called WPFCore.

2. Brushes go in BrushStyles.xml, borders go in BorderStyles.xml, and so on.

3. Each custom control has its own .cs and .xaml file.

Please let me know what you think of this organization. Is there a better way to organize them?

Also, I would appreciate your recommendation for #3. This is where Visual Studio automatically does some work that doesn't fit in my model. For example, I have a custom control called MyGridSpillter. If I go through Visual Studio wizard, it creates MyGridSplitter.cs but does not create MyGridSplitter.xaml. Instead, it creates a directory called "Themes" and puts MyGridSplitter xaml code in a file called Generic.xaml under Themes directory.

There must be a reason why Microsoft choose to do so. What is it am I missing? Won't it be better to have a separate MyGridSplitter.xaml? What do I need to do to make this happen?

Thank you in advance for your help.



Controls in webpart list


I have a webpart that cantians a list.  This list is reading from a document library and it has a chcekbox in one column and a drop down and text box in others.

What I am trying to do is, if the check box is clicked, to copy the corresponding row to another list when the Submit button is clicked.  I have the copy part done already and it copies all the items to another list when I hit submit but I only want it to copy what is selected.

Any ideas/sample code of how to do this?  Below is my code.


<script runat="server">
protected void Button1_Click(

Dialogs and ViewModel - Using Tasks as a Pattern

The ViewModel/MVVM pattern continues to gain popularity, with a blog post showing up every so often, and with tweets and retweets popping up even more often :-). At the same time, there are some interesting topics beyond the core pattern that continue to fuel experimentation. A big one amongst those is how should applications use dialogs when using the view model pattern.

The crux of the problem is the desire to keep the view model independent of UI concerns, and ensure it can be tested in a standalone manner, but that often comes to odds when you want the view model to launch a dialog, and/or do some work after the dialog is closed.

Prototype Design Pattern in C#. Vb.NET

Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype

Adapter Design Pattern in C#, VB.NET

Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
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