.NET User Control List/collection/array Property

Jun 10, 2010

I created user control. It has string[] public property (it may be List<string> or whatever). I want to support defining this property in aspx code, when declaring the instance of this usercontrol. Something like this:

<uc1:MyControl ID="MyControl1" runat="server">
<MyStringCollectionProperty>
<string>My String 1</string>
<string>My String 2</string>
[code]...

View 3 Replies


Similar Messages:

Create A User Control That Accepts A Generic List Of CustomObject As A Bindable Property?

Sep 9, 2010

I am trying to create a User Control that accepts a generic List of CustomObject as a bindable property.

I'd like it to look a little somthing like this :

TabularReport.ascx
[Bindable (true)]
public IList<T> Source
{
get;
set;
}
protected void Page_Load(object sender, EventArgs e).........

View 1 Replies

Possible To Obtain A List/collection Of All Pages A User Is Authorized To View

Jan 29, 2010

I'm using forms authentication in my C# based web site, with the authentication defined in web.config files in the various folders/sub-folders. I want to write a generic administration menu system, that lists all of the admin pages that the use is authorized to open. As I add pages, I want them to automatically show up in the menu. I need to obtain a list/collection of all pages that the active user is authorized to open. Is this possible in ASP.Net 3.5?

View 2 Replies

Web Forms :: Accessing A Public Property Of A Nested User Control In A Master Page From A Pages' User Control?

Sep 10, 2010

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?

View 5 Replies

Adding To Page Control Collection From Inside A User Control?

Feb 12, 2011

I have an asp.net usercontrol which represents a "popup" dialog. Basically, it's a wrapper for the jQuery UI dialog which can be subclassed to easily make dialogs.

As part of this control, I need to inject a div into the page the control is used on, either at the very top or very bottom of the form so that when the popup is instantiated, it's parent is changed to this div. This allows "nested" popups without the child popup being trapped inside the parent popup. The trouble is, I can't find a safe way to inject this div into the page. A usercontrol doesn't have a preinit event, so I can't do it there, and calling Page.Form.Controls.Add(...) in Init, Load or PreRender causes the standard exception "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases."

I thought I had found a solution by using...

ScriptManager.RegisterClientScriptBlock(Page, Me.GetType, UniqueID + "_Dialog_Div", containerDiv, False)

... which seemed to work well normally, but recently a coworker tried putting an UpdatePanel inside the dialog and now she's getting the error "The script tag registered for type 'ASP.controls_order_viewzips_ascx' and key 'ctl00$ContentBody$OViewZips_Dialog_Div' has invalid characters outside of the script tags: . Only properly formatted script tags can be registered."

How are you supposed to add controls to the pages control collection from inside a user control?

View 2 Replies

Web Forms :: Getting An Array Of List From Database To Client Side(javascript Array)?

May 12, 2010

Iam getting an array of list from database to client side(javascript array). Now my aim to place those values in a div one by one and that div should attach to the textbox similar to Autocomplete extender.

View 4 Replies

Web Forms :: Passing Collection To User Control

Apr 28, 2010

I'm dynamically loading a user control from a for loop against a objects collection, eg.

[code]....

I want to pass the following collection into the user control: oPerson.Address[i].listHistory (listHistory is a List of objects which I want to manipulate inside the usercontrol)

How can I pass this into the usercontrol so i can do this

View 10 Replies

AJAX :: How To Get An Array Of All The Textbox Control Inside Create User Wizard Control

Aug 10, 2010

How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

[Code]....

The above code isn't displaying hint text when the textbox retreives focus.

I think there is something wrong with this getElementsByTagName("asp:TextBox"); , I have also tried getElementsByTagName("TextBox"); , getElementsByTagName(":textbox"); and getElementsByTagName("input"); .

But no one of them gets the textboxes array.

Can anyone tell what will be the correct syntax for getting all the textboxes inside a create user wizard control using getElementsByTagName()?

View 3 Replies

List Collection That Contain A List Of Dictionary Collection - How To Use It

Feb 1, 2011

List<Dictionary <string,object>> I am reading about the list and collection, If possible, what are the different ways that I can utilize the list of dictionary collections..... gives me different examples or areas where I can use it.

View 3 Replies

Web Forms :: Get User List Based On Specific Profile Property

Sep 4, 2010

I am trying to query a DB and get a list of users based on a specific boolean property stored in the aspnet_profile for that user. I am aware that it wasn't possible a few years ago [URL] but was wondering whether that had changed in recent releases, or it was still not possible without trawling through the entire list of users and testing them one by one. (My DB may become way to big for that.)

View 3 Replies

User/server Control With Custom List Items / Create A Simple Menu User Control

Feb 18, 2011

I'm attempting to create a simple menu user control just as outlined here.

The attached code results in an "Object reference not set to an instance of an object" error, but I can't figure out why.

<%@ Master Language="VB" CodeFile="MySite.master.vb" Inherits="MySite" %>
<%@ Register src="Controls/Menu.ascx" tagname="Menu" tagprefix="my" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">......

View 1 Replies

Web Forms :: Set Button Property In A User Control From Another User Control

Mar 22, 2011

i have 2 user control : uc1 and uc2. and i have button in uc2 i call button1, i want to set commandArgument of button1 from uc1, how can i do this?

View 5 Replies

C# - Passing Reportparameter Array To Web User Control?

Jan 20, 2010

I have a user control that contains a reportviewer control.And I want to send an array of reportparameter to my user control.But I can't figure out how to do.I'm getting "Object reference not set to an instance of an object. ".My param_reportParam variable is null in usercontrol.My user control's parameter is like that ;

[Browsable(false)]
public ReportParameter[] param_reportParam [code]....

And a simple page that uses user control to show server reports is like that ;

ReportParameter[] parameters = new ReportParameter[4];//parameter number can be different
parameters[0] = new ReportParameter("imza", imzalayacaklar);
parameters[1] = new ReportParameter("Sayi_Son_Eki", "984");
parameters[2] = new ReportParameter("PersonelTip", "2");
parameters[3] = new ReportParameter("parafli", "1");
wuc_rapor_genel1.param_reportParam = parameters;//this is my usercontrol

View 1 Replies

Collection Of Property=>Value?

Jul 15, 2010

I would like to create a collection of key, value pairs in C# where the key is a property of an ASP.net control (e.g. ID) and the value is the value of that property. I would like to do this so I may later iterate through the collection and see if a given control has the properties in my collection (and the values of the properties in the control match the values defined in my collection). Any suggestions as to the best way to do this? Pseudo-code example:

Properties[] = new Properties[] {new Property(){name="ID",value="TestControl1"}, new Property(){name = "Text",value="Type text here"}}
private bool controlContainsProperties(Control control){
foreach(Property Property in Properties[])
{
if((control does not contain property) || (control property value != Property.Value))
return false;
}
return true;
}

View 2 Replies

Custom Server Controls :: Passing Reportparameter Array To Web User Control?

Jan 20, 2010

I have a user control that contains a reportviewer control.And I want to send an array of reportparameter to my user control.But I can't figure out how to do.I'm getting "Object reference not set to an instance of an object. ".My param_reportParam variable is null in usercontrol.My user control's parameter is like that ;

[Browsable(false)]public ReportParameter[] param_reportParam{ get { return _param_reportParam; } set { _param_reportParam = value; }}private ReportParameter[] _param_reportParam;

And a simple page that uses user control to show server reports is like that ;

ReportParameter[] parameters = new ReportParameter[4];//parameter number can be different parameters[0] = new ReportParameter("imza", imzalayacaklar); parameters[1] = new ReportParameter("Sayi_Son_Eki", "984"); parameters[2] = new ReportParameter("PersonelTip", "2"); parameters[3] = new ReportParameter("parafli", "1"); wuc_rapor_genel1.param_reportParam = parameters;//this is my usercontrol

View 3 Replies

C# - Dynamically Collection Property Value Assign?

Nov 10, 2010

foreach (DataGridViewRow item in dataGridView1.Rows)
{
if (Convert.ToBoolean( item.Cells[0].Value) == true)
{
foreach (DataGridViewColumn col in dataGridView1.Columns)
{
**class oclass=new class();
oclass.property = item.Cells[col.Name].Value.ToString();
Collection.add(oclass);**
}
}
}

In the above syntax,i want to fill class property dynamically.I also add my class in collection.Is it possible in C#,fill class property dynamically?My grid contain more than one column.My grid's column name are same as class property name.I want to do the bellow thing:

foreach (DataGridViewColumn col in dataGridView1.Columns)
{
**class oclass=new class();
oclass.col.Name= item.Cells[col.Name].Value.ToString();
Collection.add(oclass);**
}

View 2 Replies

EntityDataSource Using IN Clause On Navigation Property Collection?

Feb 28, 2011

I'm using EntityDataSource to retrieve my items, and i want to get the items for a particular region. (items and regions has a many to many relationship, thus item has a regions navigation property). and I'm using "IN" to filter the items. tried several combinations and it kept on throwing various errors. how can i get this sorted out:

Below is My DataSource:

[code]....

View 1 Replies

User Control - Must Supply Property?

May 28, 2010

i built a user control and i want to make one of its properties as a must, that's mean if you not supply this control when you create the control the project won't be compile, just like if you omit the runat="server" property.

View 17 Replies

Web Forms :: How To Get Property Value From The User Control

Oct 28, 2010

I have a user control that has the following property

public string ReportID

View 6 Replies

Add Description To An User Control Property In Vb.net?

Jul 10, 2010

I created one web user control with property named "ReadonlyField" with boolean datatype. I am able to use in my web pages and now i wanted to add a description to that property so that i dont need to explain each time to my team member what is that property's intention.

I got following snippet in c# but didnt find any equivalent in vb.net and also not sure whether it will work or not.

[Description("My Description")]
public int MyIntProperty
{
get {..}
set {..}
}

View 1 Replies

How To Map A User Control Property To A Server Control Within It

Jun 2, 2010

I have a user control with a WebDateTimeEdit server control on it (essentially a TextBox). I'd like to be able to set some of the server control's properties by way of the user control's markup or programatically. for example I have this defined on my user control:

[code]....

this blows up because WebDateTimeEdit1 is null.

is there any way I can make this happen? also can do I do this

myControl2 .Font.Size = FontUnit.Point(8);

where the Font property is read only on the server control?

View 2 Replies

Can Insert User Control With Inner-tag Content As Property Value

Apr 16, 2010

I have a control that I want to be able to mark areas as editable. When a user enters a username and password, they can then edit these editable areas.One of the area to edit is the main content of the page. Since I want them to be able to edit this on every page, I have put the editable control into the master page, wrapped around the ContentPlaceHolder of the master page.I found out how to allow the parser to allow <prefix:tag></prefix:tag> rather than just ending it with />, but I can't figure out how to get the text within the tags to be accessible through something like a Text property. A prime example of this behavior is the Label control, where you can put <asp:Label>Hello!</asp:Label> and access Hello! through the .Text property in the code.

View 10 Replies

Access Page Property From User Control?

Apr 2, 2010

how to access a property on my parent page from a user control?

View 2 Replies

Setting A Property For A User Custom Control?

Jan 25, 2010

I have created a user custom control, and what I would like to do is to pass it the text value from a label where I can carry out some other processing.

View 2 Replies

C# - User Control Not Retaining Property Values?

Oct 28, 2010

I have a very simple user control with 5 radio buttons on it, and 3 properties (ID, RatingSetID, and Rating). On the initial load of the page they are on, the code acquires data and places the data into the 3 properties. However, when the submit button is clicked the page reloads and the 3 properties get reset to 0, they are in the !IsPostBack as well.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved