.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

Accessing Property of Webpart

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :SharePoint
Hello All   I am having one scenario where i need to access property of webpart1 in webpart2 Example : Webpart1 has property max records to display which user sets from UI side and fetch data from list upto the property set. Webpart2 also needs to display records from the same list used in webpart1 but there records displayed should be records after displayed in webpart1. i.e. if webpart1 displays records as (1,2,3) then webpart2 should display records as (4,5,6). So please let me know how i can access property of webpart1 in webpart2   I would be thankfull for any reply   Thanks & Regards Mrugank Dholakia

View Complete Post

More Related Resource Links

Accessing a public property of a nested user control in a master page from a pages' user control

Hi  I've got a web site that has a master page and that master page (mpMaster that has a user control (ucControl1) which has a sub user control (ucControl2), this user control has a property which accepts a value. Now, I have a page that uses the master page and on this page I have another user control (ucPageControl), I need to  find a way of setting the value in ucControl2 from ucPageControl. Is this possible at all? Many thanks Ed

Dynamically Setting the property value FilterValue1 of the Content Query WebPart? Inline? codeblock?

I want to dynamically set the FilterValue1 property of a Content by Query to the querystring ID. I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck Without having to code my own webpart, any way to change the value with a small C# code block? How about with javascript? Thank you!    

Accessing Custom Property in HTML???


i have a usercontrol with a few dropdownlist....n i am using that usercontrol in few pages and depending on pages those dropdownlist  can be enabled mode or disabled mode.

so i created a property:

private string _readOnly;
        public string ReadOnly
         set {
                if (value == "true")
                    ddlOTime.Enabled = false;

Now i am accessing in HTML as

<uc3:OpenTime ID="OpenTime1" OTime='<%#Bind("OpeningTime")%>' ReadOnly="true" runat="server" />

it seems to work.

Just curious know that am i going in right direction or any better approach is available?


Accessing ModifiedBy property from API


I have a site which I did a restore from another server. I have a custom search part on my site which queries the scope for a list of files and their attributes. When I go to a document library or a list I can see that the modified by property is set to the proper value, but when I run a search through my custom search part, modifiedby is returned as 'System.String[]' for every file. If I set the source code to display the 'author' attribute, the value is returned correctly. Any ideas on why this is happening?

EDIT: I get 'System.String[] ' returned in the API for the modified by attribute, even when I upload or modify a file on the new server.


Accessing SelectedItem of DropDownList in WebPart Custom Properties



I've made a simple Visual Web Part using an AJAX timer to count down to dates.

I have added a custom property which is a list of events, but I cannot find the Selected Item value in my ascx.cs file.

Here is how the property is set:















 VisualWebPart1 : WebPart




 EventList myEventList;


), Category("Configuration&quo

Taxonomy Field Picker in Custom Webpart Property Panel.


Hi Guys,

How can i Use Taxonomy Field Picker like in Content Query Webpart Property Panel in Custom Webpart.



Thanks Ron

How to insert a button as WebPart Custom Property.

I want to inset a button as Webpart custom property. any idea how to do it.

Listview Webpart "rootFolder" private property issue in sharepoint 2010


We have used listview webpart to display document library.

The ListViewWebPart contains a private variable called 'rootFolder' that contains the current folder the webpart is displaying.

Below code snippet is used to obtain the value of the private variable contained within the ListViewWebPart.

private static object GetPrivateFieldValue(object obj, string fieldName)


    FieldInfo fi = obj.GetType().GetField(fieldName,

                            System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);


    return fi.GetValue(obj);



However, This is

Accessing Property Value of a Custom Control by another Custom Control in Design-time



I created an Extender which has a custom property that drills down a list XML elements from an xml file, where users can select xml elements during design-time. This works perfectly fine. However, my code only has a hardcoded xml filename (source of the xml elements list) and I need to change this by maxing the xml file user-specified.

What I did is that I created another control (panel) which has a custom property that when clicked (through the ellipsis), it will allow a developer to select the xml file which is supposed to be the source xml file that the Extenders shall use. The filedialog from custom panel's property works perfectly fine.

However, my problem now is that when I drag-drop my Extender, I cannot find a way to get the property value of the custom Panel Control which contains the xml filename. I tried creating a static variable which I thought the custom controls can share but VS2010 is breaking.

Please take note that my problem is on Design-time, asp.net.

Appreciate any help. Thanks a lot.

Dhon Nuevo.

Accessing an Array of Strings Property from WCF Client


First let me apologize for the elementary question, but I’m not a developer by trade and only have to put that hat on when needed for work.  However, I’ve written a WCF service that contains an array of strings as a DataMember .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace OBCreateEForm
  public class EForm
    [DataMember(IsRequired=true, Name="EFormDocTypeName", Order=0)]
    public string EFormDocTypeName { get; set; }


Nested Databinding of Object Accessing Parent Property


I'm wondering if there's a way to access a parent properties in databinding, of if I am going to have to re-write some objects to pass down data.

Pseudo Example:

Cars Generic of Car
Car Properties: Id, Makes

Makes Generic of Make
Make Properties: Id, Name, Models

Models Generic of Model
Model Properties: Id, Name


repeater (datasource = cars)
---repeater (datasource = Makes)
..........<%# Eval("Name") %>
------repeater (datasource = Models)
..................<%# Eval("Name") %>  <%# Eval("??? Make.Id ???") %>

So in the nested repeaters, I somehow need to access the parent's Id. In this example the Make's Id.
Is this possible?

Or do I need to add Property to child objects that refer to the parents?


Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Accessing SharePoint 2010 Data with Server-Side APIs

Accessing SharePoint data in server-side solutions is one of the most common tasks that you will perform as a SharePoint developer. SharePoint 2010 provides powerful server-side APIs that enable you to retrieve, add, edit, and delete SharePoint data programmatically. SharePoint 2010 also includes the new LINQ to SharePoint technology that enables you to work with SharePoint data efficiently and easily.

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo
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