.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

Is it possible to pass property accessible modifier as a template parameter

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :.NET Framework


I have a class, i want to make instance of this class as read-only or not, based on the context.

I am not sure whether this can be done by PropertyDescriptor, i am expecting some kind of generic based solution.

Thanks for your reply




View Complete Post

More Related Resource Links

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?

How can I pass a parameter into my report?


I looked all over the forums, spent about a day on it, found numerous people having similar problems passing a parameter, but all the solutions I found so far were partially incomplete or incompatible to my project. I tried using a few of the "solutions" and they generated exceptions. I'm using straight ASP.NET so far with no c#. Is there a way to do it without code behind?

If someone suggests a solution I would be very grateful! Laughing I'm certain that if you provide a complete working example that others in the future will be very grateful as well.

Here is what I have thus far:

I used studio to create an .ASPX web form, and I used the report wizard to create a .RLDC file on the .ASPX page.

When I execute it, it works! Beautiful... Now how do I pass it a parameter?

So this is what I have below (which works), but I want to pass in a single int32 parameter to the stored procedure usprptGetData in which it is based.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="My_Reports_Guarantor" %>

pass parameter between datasets



I've a user table, and contact table linked to it, and appointments where contact are linked to it with users in this in it.

I need a report which show ...by user number of contact created by this user and number of appointment created

so i guess i need two datasets but how can I pass parameters between them to know what is the current user id ..?

thanks so much  

In a style template, express a property in terms of the controls properties it is applied to.

Hello,   In the style template below, which works fine, I'd like to express the "Points" property in terms of the applied to controls "Width" and "Height" properties.  As you see, the "Fill" property is expressed in terms of the "Background" property the template is applied to by means of Fill="{TemplateBinding Background}".  The following does not work:   Points="0,({TemplateBinding Height} / 4)  ({TemplateBinding Width} / 12.5),({TemplateBinding Height} / 4) . . ."   Is what I'm looking for possible, all in XAML, no code/converters? <Style x:Key="FolderButton" TargetType="Button"> <Setter Property="Margin" Value="2.5" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Polygon Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" Points="0,5 4,5 6,0 23,0 25,5 50,5 50,20 0,20"/> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> </Grid> </ControlTemplate>

Creating a volume control slider/setting one template property based on another

So, what I want to do, is to make a volume control that looks like a right angle triangle with the 90 degree angle on the bottom right, and then when you click on it, the area to the left of the selected point is shown in a different color.  In other words, I've created a slider with the right background, what I can't do, is work out how to show the selected area by filling in the triangle.  I have worked out how to bind the height of my triangle on the left to the value of the control, but right now, the rate of rise is exactly half of what I need it to be.  I need to know how to change the template for the area to the left of the selection ( which is the repeat button ) so that the background is twice the height that it is right now.  No matter what size I make the slider, the area is always 1/2 the size it needs to be, so I am sure if I could get it to double inside my template, it would work fine. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">       <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">         <Setter Property="SnapsToDevicePixels" Value="true"/>         <

How to Pass value to gridview parameter?

Dear all, I have grid view and i want to pass parameter value for it from where clause... my parameter value is not control, or session or cookie.its a variable ...how can i pass this variable to grid view parameter?   thanks 

How to pass current user's login name as parameter to a RDL . (SSRS integration with sharepoint)

I have a webmethod which has two parameters. One is for year and another is for Currently logged in user. I call this method in RDL file. From RDL File how can we pass Currently logged in user's login name? I tried  with USER!UserID. It is passing the USERID but i need to pass the login name(SPWEB.currentuser.loginname)  

How can i pass function as parameter to show in gridview

Hello, I have one common Data Access function which returns output as dataset which is as below   Public Shared Function ExecuteDataSet(ByVal sql As String, ByVal type As CommandType, ByVal ParamArray parameters As SqlParameter()) As DataSetDim RetVal As Object = Nothing   Try Cmd = Cmd.Connection = OpenConnection() Cmd.CommandType = type Cmd.CommandText = sql Cmd.Parameters.AddRange(parameters) Sda = Ds = Sda.Fill(Ds)       New SqlCommand()New SqlDataAdapter(Cmd)New DataSetCatch ex As ExceptionThrow New Exception(ex.Message.ToString())Finally CloseConnection() Sda.Dispose() End Try   Return Ds End Function   this function normally i use to get data from database and returns to dataset   now,I want to created one more function which output type is gridview and its parameter is  dataset which i got output in previous funtion   i want like this public funtion BindDatatoGridView(ExecuteDataSet("SELECT...",commandType.text,Parameter....)) as GridView End Function   how can i solve this, please help me out

Pass parameter to Hidden Field in SSRS Report

Hi, I have Two Columns in a Table Say As Table1 Column1 = Text Column2= id My SSrs Report has two parameter values as Column1 and Column2. Column2 should be hidden SELECT DISTINCT COlumn1 FROM Table1. i have passed this query dataset to Column1 parameter. Now My requirement is that, when ever column1 drop is selected. the hidden field column2 should fecth the corresponding ID. this column2 has Storeprocedure which will Display the Output when View Report button is clicked Thanks, Saraswathy

Pass ID parameter to other views

Hi, I'm new to MVC, so now I run into some problems, hope you can help!I took the MVC 2 template that comes with VS2010 and modified it to my needs. There are now 5 different tabs in the menu, I've implemented models and controllers and that works. But actually, the entire site should show data based on and ID (it pulls data from a webservice).For example account info for id=1: http://localhost:49925/AccountInfo/details/1This is always the URL where one enters the site (page will be linked to from another site, so the ID will be passed from there)So how can I pass the ID to the other Views (let's say I also have a 'Contact' tab: http://localhost:49925/ContactInfo/details/1 )I've solved it now by storing the ID as public property, so I can retrieve it in other Controller classes, but I think there must be a better way to do this.. Also I would like to have a title in the header of the master page that shows the current account (e.g. "Showing data for account FooBar"), how can I set this from the AccountInfo controller/model(?)

Any way to pass Multiple Values for a single Label in the Parameter?

  I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610" One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter.  PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data. Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610. QUESTION: Any way to pass Multiple Values for a single Label in the Parameter? I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting it correct. I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….   Note: We are using Report Builder 3.0  

Unble to pass date parameter to "Go to Report " ?


Hi ,

I have Report A need to go from Report A to Report B passing multivalued parameter and date parameter as well , I do not have any problem passing  Multivalued parameter but cant pass date parameter from Report A and Report B .

Report A : Date parameter properties

name : date

Data Type : Date/Time

Default value =Today()

Report B : Date parameter properties

name : date

Data Type : Date/Time

Default value =Today()

Go to Report action ,Expression used to pass date parameter  from Report A to Report B


Unable to pass appropriate date parameter if changed from default value from ReportA to ReportB .

Assistance would highly be appreciated !!

Thanks .

Rajkumar Yelugu

How to pass parameter to web page without displaying it?


Hello everybody.

The subject of the thread is my question. I don't know whether or not it is possible. Actually in my project currently I'm feeling a need to capture a bitmap image of a web page to insert that image into pdf document. And according to the need I don't want to display that page but want to pass values as parameters to that page. Is it possible? If so, how can I do it? Any information would be very helpful to me.

Thank you.

pass a dynamic parameter in a WCF method on HTTP GET


i have a WCF method with 2 known parameters and another one thats supposed to include a Key:Value pairs (dynamic parameter that will include an unknown number of key:value pairs).

the first question is :

i don't want to use XML as the dynamic parameter. what is the common way to pass the dynamic parameter in a WCF method? Dictionary<string,String>? json string? array of complex types? or other? ( my client - the one that uses my service, doesn't have Framework 3.5, so i suggested a framework 2.0 ways to send the parameter)

the second question :

the method  supports HTTP GET , should a dynamic parameter be passed in the URL itself or in the Header? i prefer the URL itself....


thank guys, please help ....

Is it possible to pass textbox value as a parameter through hyperlink? Thanks

Is it possible to pass textbox value as a parameter through hyperlink, with the press of a button or without? Thanks
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
       <br />
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Button" />

        <asp:HyperLink ID="HyperLink4" runat="server" 
        NavigateUrl="~/ASPInvoiceGrid.aspx?PONumber={0}" Target="_blank">Invoice Details</asp:HyperLink>


How to pass SQL server 2005 instance name as a input parameter to restoressp STSADM command


I am facing a problem with restoressp STSADM command. We are using a separate SQL server 2005 instance for our SharePoint PORTAL. For e.g. the instance name is MOSSSQL. I have restored the SSP database from production environment to development environment. But facing the problem when I associate the restored SSP database with new SSP using restoressp STSADM command.

As per Microsoft guideline I have used the restorespp command to attach the database with my new SSP. If I pass the sspdatabaseserver input parameter as “servername\SQL instance name” then its giving me the error message that “required argument are mission – sspdatabase”.

Below is the command

stsadm -o restoressp   
-title “My-SSP"
-url "http://mymoss:11111/"
-ssplogin "username"
-mysiteurl "http://mymoss/mysites/"
-indexserver "MYMOSS"
-indexlocation "e:\logs\"
-sspdatabaseserver "MYMOSS\MOSSSQL "
-sspdatabasename "MySSP1_SSP"
-ssppassword "password"
-searchdatabaseserver "MYMOSS\MOSSSQL"
-searchdatabasename "MySSP1_Search"
-ssl no

Note: I have system admin rights and I am the DB owner



Senthilrajan K
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