.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

Can I assign a property of a custom web part via a URL parameter?

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :SharePoint

Hi there,

I am wondering if it is possible to assign the properties of a custom web part by passing parameters to the sharepoint URL of that web part.

Thanks and best wishes


View Complete Post

More Related Resource Links

not able to set custom property of web part on page load


I am not able to set the custom property of the web part on page load.

It gives me exception if i try to get or set that property but i can still access other inbuilt property of the web part and can display them on the page.


I am using sharepoint designer and MOSS 2007.

How to create a new (custom) UserProfile property and assign it to an existing (out of the box) sect


I can create a new UserProfile property using the code snippet below; but how do you assign such a property to an existing, out of the box, SharePoint section/category such as "Basic" or "Contact Details" please?


			CoreProperty coreProp = cpm.Create(false);
              coreProp.Name = customProp.Name;
              coreProp.DisplayName = customProp.DisplayName;
              coreProp.Description = customProp.Description;
              coreProp.Type = customProp.Type;
              coreProp.Length = customProp.Length;
              coreProp.IsMultivalued = customProp.IsMultiValue;
              coreProp.Separator = customProp.Separator;
              ProfileTypeProperty profileTypeProp = ptpm.Create(coreProp);
              profileTypeProp.IsVisibleOnEditor = customProp.IsVisibleOnEditor;
              profileTypeProp.IsVisibleOnViewer = customProp.IsVisibleOnViewer;
              profileTypeProp.IsReplicable = customProp.IsReplicable;
              ProfileSubtypeProperty profileSubTypeProp = pspm.Create(profileTypeProp);
              profileSubTypeProp.IsUserEditable = customProp.IsUserEditable;
              profileSubTypeProp.PrivacyPolicy = cu

Web Part Custom Property Text Values Showing Up on Page


I've created a basic Web Part in a .wsp and defined two custom web properties.

However, whatever value I place in these text values when in the edit mode show up on the Page beneath the Web Part name.  Why?  How do I not show the value of Properties outside of the Modify Property window?

Custom Server Control Property not maintaining state


I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below


<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.


What am i missing





Windows XP: Escape from DLL Hell with Custom Debugging and Instrumentation Tools and Utilities, Part


Building on his article published in the June issue, which demonstrated several ways to get process and DLL-related information from APIs such as PSAPI, NTDLL, and TOOLHELP32, the author presents some unusual ways to get system-oriented info that you can easily integrate in your own toolkit. There are three tools included as samples: LoadLibrarySpy, which monitors an application and detects which DLLs are really loaded; WindowDump, which retrieves the content and a detailed description of any window; and FileUsage, which redirects console-mode applications to tell you which process is using any opened file.

Christophe Nasarre

MSDN Magazine August 2002

Unable to search Custom User Property Created in User Profiles in SharePoint 2010


Hi ,

I have created a custom user property,and created metadata property and added mapping to it, still i m not able to Search in People,Please advise

How to pass a parameter from a choice filter with project IDs to a KPI web part?



I have an excel pivot table like this:

Report Filter: Project ID
proj_name     Status 
A              70
B              60
C              80

I have this workbook published onto Sharepoint server through excel services.
On the site i have a choice filter that has all the project ID's. I am able to show this table in a web part and filter the web part by passing parameter from the choice filter to the report filter in the workbook as shown above.
I added a KPI webpart that uses the "status" from the above table as its indicator value. What I want to do is that I want to pass the parameter from the choice filter on the site to this KPI web part so that it will show me the corresponding status dynamically accoring to the project chosen.
Can someone help me solve this problem?

Need Suggestions for my Custom Web part


Hi All,

This may be a little longwinded to give you all the details so please bare with me. I'm hoping someone has some creative suggestions regarding how to approach a problem I'm having.

I've created a web part which reads list items from an announcement list. I then display the "title" field as a link on the web part for the most recent 5 items. When the title link is clicked, it uses jQuery UI to pop open a window and display the body. Currently, when a list item is displayed, I programmatically give that table row a class name.

Example: If there are 3 list items, item 1 would have a class name class="item1", item 2 is class="item2" etc.. Currently I have a hard stop at 5 items. This is because the jQuery looks for the class names in order to know which body to display. So in my js file I have those class names hard coded up to 5 items.

Finally! The problem I'm having is that I can't have multiple instances of this custom web part on the page due to the class names. If I have 2 instances of this web part on the same page and I click the first item from one of the web parts, the body of the first item on both web parts opens. Because both have the class name "item1". I am looking for suggestions regarding how I can implement this in a way that will allow the class names to be auto generated (proba

Problem in Custom Control Unable to find Control To Validate Property


I make a custome control by taking a TextBox and A Regular Expression Validator.When i Use this on a .aspx page it works fine.But when i use this on .ascx page and dynamically load user control on a place holder in .aspx page it through an Error

Unable to find control id '_ctl0:txtEmail' referenced by the 'ControlToValidate' property of '_ctl0:txtEmailRequired'


My Custome control Code is this"--

public class EmailValidator:System.Web.UI.Control, INamingContainer{

private System.Web.UI.WebControls.TextBox textBox;

private System.Web.UI.WebControls.RegularExpressionValidator regularExpressionValidator;

public EmailValidator(){

textBox = new TextBox();

regularExpressionValidator = new RegularExpressionValidator();

IsErrorTextBelow = true;

IsRequired = false;

DateTime custom managed property search fails with " Your query is malformed. Please rephrase your q

I've created a front end search page in Silverlight 4 for SharePoint Search.  Currently we are using WSS 3.0 + Search Server Express 2008 (v  The page interacts with the MOSS version of the search web service at:   <site collection>/_vti_bin/search.asmx The reason for this approach is the unique way the requirements specify the look and behavior of the results.  The built-in Search Center page or web parts will not satisfy these requirements. We are going into production but I still cannot figure out how to search against my custom managed properties that are of Type DateTime.  If I cannot get this to work, it is a showstopper. I've tried numerous variations on the SQL Syntax and cannot get it to work.  I know the error is in the date portion of the WHERE clause since I can remove it and searches work fine. Here is a working query: SELECT Size, Rank, Path, Title, Description, Write, RequestSubmittedDate, DocumentType, RequestPromisedDate, ProblemDescription, DatePublished, RequestOwner, RequestingDepartment, DocumentAuthor, ProjectNumber, ProjectDescription, RequestStatus FROM scope() WHERE CONTAINS ('"nmr"') ORDER BY "Rank" DESC yet if I try to use a date literal in the WHERE clause as in the following query modification, I get the "malformed"

Overriding web.config in sharepoint webpart/using custom membership in web part

I'm developing a web part for MOSS 2007. The web part is being deployed to a web application which utilizes forms-based authentication, and role/membership providers to control users. The membership table has been edited to include addition user info (I am aware, that this isn't the best way to handle additional user, i.e. profiles etc., however, this is a requirement from another department). Since my web part needs to access this information, I was thinking of implementing a custom membership provider. So far I've followed: http://msdn.microsoft.com/en-us/library/6tc47t75.aspx and I've got my custom membership class, and a very stripped down membershipprovider-class. But how do I enable/use this membership provider in my web part? I've tried creating a simple web.config in the "WebPartCode" folder of my solution, next to my webpart code file, with connection string and membership provider tags. But I don't even really know how to build/reference/use the membership provider itself, so I don't know what else I need to do. I've built a C# class library project with the two classes (membershipprovider and custom membershipuser) and compiled it and installed it in the global assembly cache - is this correct? and how do I access them from here? Hope someone can help

remove web part from custom site defintion

Hi,    I need to remove a web part from a custom site defintion. The links web part needs to be removed from the site defintion.  I have recreated the site definition from sts . I found this good article (http://blogs.msdn.com/b/sharepoint/archive/2007/03/22/customizing-moss-2007-my-sites-within-the-enterprise.aspx). but a bit lost as i can't find the wp.gettype method the author is using. I am open to suggestion or  is there  a way to remove the web parts by creating a user control which would remove the web parts.  

how to apply css to custom web part?

I've created a custom web part in visual studio 2005. i want to apply style sheet to this web part? how do i do this? where should i add reference for css in custom code?

Is it possible to give parameter to the Page Viewer web part?

Page viewer web part gives iView to the website eg. http://www.test.com. This works fine! Our customer would like give parameters like http://www.test.com/abc?name=John. First question is that is it possible to give personalized parameters to the url? Any chances to give SharePoint user name as parameter?  Kenny_I

Custom Web Part Problem After SharePoint Restore

Hi, I've recently moved our sharepoint site and databases (using Microsoft Internal Database) to another standalone server. I did a catastrophic backup and then restored it on the destination server successfully via the central Administration page. I have also copied our custom web part library dll to 'c:\windows\assembly' directory and 'C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin' directory. I also copied over the old web.config file to 'C:\Inetpub\wwwroot\wss\VirtualDirectories\80'. However, I still seem to be missing something as I get the error below while loading the site. I haven't been able to find a solution so hoping someone has seen it before here. Has anyone seen this happen before? Any advice/help would be greatly appreciated. Many thanks. Mehds ERROR====================================================================================================== The “webpartname” web part appears to be causing a problem. Object reference not set to an instance of an object.  Web parts maintenance page: if you have permission, you can use this page to temporarily close web parts or remove personal settings. For more information, contact you site administrator. ==========================================================================================================

Struggling to assign the parameter value for the RDLC report, VS2010

 Struggling to assign the parameter value for the report, I saw so many helps in this forum. seems i have the same error comes again after i click the button. pls help what i miss in the below?   Following is my .XSD (DataSet) SELECT     [Order Details].OrderID, [Order Details].ProductID, Products.ProductName, [Order Details].UnitPrice, [Order Details].Quantity, [Order Details].Discount,                       CONVERT(money, ([Order Details].UnitPrice * [Order Details].Quantity) * (1 - [Order Details].Discount) / 100) * 100 AS ExtendedPriceFROM         Products INNER JOIN                      [Order Details] ON Products.ProductID = [Order Details].ProductID <div> <asp:Label ID="lblMessage" runat="server" Text="Label"></asp:Label> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="OrderID" DataValueField="OrderID"> </asp:DropDownList> <asp:Button ID="Button1" runat="s

core results web part - Property doesn't exist or is used in a manner inconsistent with schema sett

I edited the Fetched Properties section of my core results web part and added a mapped column <Column Name="owstaxIdKeyword"/> When I reload my page, I get this error: Property doesn't exist or is used in a manner inconsistent with schema settings.
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