Add Custom Properties Into Control Objects In ExtJs

Jan 25, 2010

How can I add custom properties into control objects in ExtJs.

For example :


This control comes from server dynamically and I want to write my custom property as well like below :


I tried it but it said undefined. Normally since JavaScript is loose, I can easily modify objects but in this case it wouldn't work the way I expected.

View 1 Replies

Similar Messages:

Custom Server Controls :: Custom Control's Constructor / User To Set That variable In The Properties Window After They Drag The Control Onto A Form?

Mar 4, 2010

I have a custom control which inherit from the Table class and in the constructor, it takes a an integer as an argument. There is no empty constructor.

Is there a way for the user to set that variable in the properties window after they drag the control onto a form.

I know some .NET controls, you can set the source for the parameter to different things like another control's property, QueryString using just the properties window.

Right now, I have to create the control dynamically. I read the query string and then created the object.

View 1 Replies

Custom Server Controls :: Binding Properties Of A Custom Control In A ListView?

Jul 6, 2009

I have a custom control derived from CompositeControl that I'm using in the EditItemTemplate and InsertItemTemplate of a ListView. The ListView's data source is an ObjectDataSource.

I use <%#Bind('fieldname') %> to bind the properties of my custom control. I have found that the data will be displayed in my custom control, but when I try to update or insert, the data is not retrieved. I checked the onitemupdating event and saw that NewValues.Count was zero.

Does my custom control need to implement somthing special in order to return its data?

View 4 Replies

Custom Server Controls :: Custom Control And Properties Window?

Jun 1, 2010

I have made a composite control that has 1 Label Control ,1 TextBox ,1 button and 1 Panel Control. Below is my code:

namespace ServerControl1


The above code compiles without any error. Also I can drag and drop this control from the Toolbox of my Project on my web form. However I am unable the change the value of my fromLabel control.It allows me to change the value in the properties window.But when I run the form it always shows me its default value which is "From". I want it to be flexible so that any one can change the value in the properties window.

View 3 Replies

Custom Server Controls :: Why Custom Gridview Control Not Render HTML Properties Under Properly In Visual Studio 2005

Mar 5, 2010

Why custom Gridview control not render html properlies under <Columns> properly in Visual Studio 2005?

For example:


View 1 Replies

Custom Server Controls :: Expose All Properties Of A Child Control In A Composite Control?

Sep 14, 2006

I have a composite control consisting of a GridView and a TextBox.

Is there any way I can expose all properties of the GridView without delegating each property individually?

Eg: Is it possible to do a :


How can I acheive this kind of thing? Is there any way to get this to work in composite controls where we can delegate all properties of a child control to the control at a time or do we have to write get-set for each property we wish to delegate to child control?

View 2 Replies

C# - Setting Custom Control Properties?

Apr 20, 2010

I though it would be very simple but I can not get it today.I have a user control, with a grid control contained in it.

public Unit Width


View 1 Replies

MVC :: Set Properties Of Custom Control Dynamically Without Codebehind?

Jun 10, 2009

I am practicing not using codebhind in my view pages. So I have my own custom server control (which I need to use, there is no way around that) In my controller class, I set this viewData:

ViewData["MyCustomControlText"] = "Hello World";
In my view page. I want to set Text property of myControl...something like this:
Text="<%=ViewData["MyLabelText"].ToString(); %>"></myControl:label

This won't work... it just literally prints out <%=ViewData["MyLabelText"]; %>. This is really easy if I had codebehind.

View 1 Replies

Custom Control Properties Not Initializing Properly

Dec 14, 2010

The First - LblTextBox:

A label and textbox that have a LabelText field that can be set to change the label text

The Second - LoginCtl:

A login control that has two instances of LblTextBox for user name, password and a submit button

I want to control the tag rendering of these controls for formatting so I am not overriding CreateChildControls() to get the job done.

My issue is that the controls are rendered but none of the OnInit() code in either controls takes hold (blank labels, css styles not applied, etc..).


View 2 Replies

Web Forms :: Get List Of Custom Properties Of User Control?

Sep 15, 2010

With following code, I can fetch all properties of user control. I need to get only those properties which were separately defined excluding the default ones.


View 2 Replies

Jquery - Creating A Custom Control In Javascript Properties And Methods?

Feb 23, 2011

As a starting point for creating custom controls, I would like to make a control that simply displays a number. If we imagine the .ascx file contains nothing except for a literal control, and the code behind sets that value to 1.

I then want to be able to do myControl.increment();
This will run some javascript that increases the value of the literal control.

I could inject a javascript into the page, such as pseudocode:

scriptything.register("function increment(x) { $('#myLiteral').increment(); });

or something, but that wouldn't be myControl.increment, that would just be increment(). More than one control on the page would screw it up.

View 2 Replies

Custom Server Controls :: How To Control Child Properties And ViewState

Dec 26, 2008

I am developing a customized validation server control . I am trying to save validations as child property but i am unable to do so if i write property in html view control is not picking it and if i write properties through ... button on propertyeditor then values are not saved in design html.

also tell me that where to maintain control's View State.


View 3 Replies

Missing Intelligence While Describing Custom Control Properties Declaratively

May 21, 2010

I've been working on this project for a few days now, and have been unable to resolve the issue of getting intellisense support for my custom-defined inner properties for a user control (ascx, mind you). I have seen the solution to this (using server controls, .cs mind you) many times. Spelled out in this article very well. Everything works for me while using ascx controls except intellisense. Here's the outline of my code:

public partial class styledcontrols_buttons_BreadCrumb : System.Web.UI.UserControl
public List<BreadCrumbItem> BreadCrumbItems
get { return _breadCrumbItems; }
set { _breadCrumbItems = value; }
protected override void AddParsedSubObject(object obj)
if (obj is BreadCrumbItem)
BreadCrumbItems.Add(obj as BreadCrumbItem);
public class BreadCrumbItem : ControlBuilder
public string Text { get; set; }
public string NavigateURL { get; set; }
public override Type GetChildControlType(string tagName, System.Collections.IDictionary attribs)
if (String.Compare(tagName, "BreadCrumbItem", true) == 0)
return typeof(BreadCrumbItem);
return null;

Here's my mark up (which works fine, just no intellisense on the child object declarations):

<%@ Register src="../styledcontrols/buttons/BreadCrumb.ascx" tagname="BreadCrumb" tagprefix="uc1" %>
<uc1:BreadCrumb ID="BreadCrumb1" runat="server" BreadCrumbTitleText="Current Page">
<BreadCrumbItem Text="Home Page" NavigateURL="~/test/breadcrumbtest.aspx?iwentsomewhere=1" />
<BreadCrumbItem Text="Secondary Page" NavigateURL="~/test/breadcrumbtest.aspx?iwentsomewhere=1" />

I think the issue lies with how the intellisense engine traverses supporting classes. All the working examples I see of this are not ascx, but Web Server Controls (cs, in a compiled assembly).

View 1 Replies

Custom Server Controls :: Can't Set Value In Properties Window Of Composite Control

Aug 4, 2009

I've created an Composite Control with a CheckBox and a RadDatePicker (telerik controls). I've exposed the Checked property from the Checkbox through a public property.It happens that when using my checked property in the properties window in design time in a ASP.Net project my set value disappears on blur,but it is added in my aspx code page as an attribute.I've tried to replace the CheckBox/Checked with a Label/Text property and the same happens.
Here is my code:

View 5 Replies

Web Forms :: Setting Custom Properties Of A User Control Loaded In A Web Part

Sep 15, 2008

I've created a user control with some custom properties. Next, I've created a web part where I loaded my user control and added a label.

I've connected this web part with another web part and I'm setting both the value of the label and the value of one property of the custom control to a string variable that I receive from the connection.

The label text is being correctly updated, but the user control property isn't (I know this because I have a button on the control that puts the contents of the custom variable in a textbox and nothing is appearing there).

View 7 Replies

How To Expose Child Control Style Properties In A Custom Composite WebControl

Feb 23, 2010

I am writing a custom composite WebControl and want to expose styles of child controls it encapsulates to the ASP.NET designer. The code I currently have is similar to the skeleton below (which for simplicity only has one child control).

With the code below, I can see property "ChildPanelStyle" in the designer, but when I try to modify one of the properties (e.g. CssClass) in the designer, it immediately resets itself to its default value. It looks like the designer serialization isn't happening.

What am I doing wrong?


I've updated the sample with an additional style property that is managed directly by the custom control, rather than simply being the property of a child control.

The HeaderStyle property is persisted properly by the designer, but the ChildPanelStyle property isn't.

Of course I could manage all my styles like HeaderStyle, and apply them during rendering, but I'm hoping there's a simpler solution whereby child controls can take care of themselves, and I don't need any custom rendering.


View 1 Replies

Custom Server Controls :: Composite User Web Control - Properties - Best Practice

Jan 12, 2011

I would like to ask you what is the best practice for developing composite user web control with multiple controls inside from the stand point of dealing with properieties. In my situation I would like to use header menu bar with logos, buttons, java baset visible/hidden menus itc as web control. I was successfull in implementing new control in my project.

But my question goes to issue of properties for ALL OF controls. I know how to hard code all required properties like: text, visible, enable for all controls. It's a lot of work. ( This is the very edge of my comprehension ) Is there a more elegant way provide an access to controls's properties without hard coding seperatelly?

View 12 Replies

C# - Load A User Control In An Ajax WCF Service And Access Custom Properties?

Apr 4, 2011

I can load a generic user control just fine in my WCF service doing the following:

UserControl userControl= (UserControl) new Page().LoadControl("~/UserControls/MyControl.ascx");

However i can't seem to find any way to do this

MyControl myControl=(MyControl)userControl;

The reason i need to do this is because my user control has a custom property, person, I need to do the following:

myControl.Person=new Person();

essentially i need to simulate:

<%@ Reference Control="~/UserControls/MyControl.ascx" %>

which normally goes inside page or master-pages.any way of doing this in an Ajax Enabled WCF Service?

View 2 Replies

Does A Composite Server Control(inc. User Control, Custom Server Control) Normally Encapsulate Css Properties?

Nov 7, 2010

If a composite server control normally encapsulate styling information inside, it is an example of code encapsulation and modularization. However if css properties are included inside the composite control, it is not ideal for code/styling separation and css code re-use principles. Now which consideration should be the main consideration?

View 2 Replies

Custom Server Controls :: User Control Can't Access The Parent Pages Public Properties

Feb 27, 2008

I have built a page that is contained within a master page and it holds 2 user controls

Control A contains a DataList

Control B contains a FormView

I want to pass the selected index from the DataList on Control A to the FormView on Control B so it acts like a master / detail scenario

I created a public property on the page that contains both controls called DataListSelectedIndex A also created a public property for DataListSelectedIndex on the Control I populate the DataListSelectedIndex property of the Control when the DataList_SelectedIndexChanged event is fired And I populate the DataListSelectedIndex property of the page on the OnLoad event of the page.

My problem is that on Control B - (or Control A for that matter) I can't access the public property DataListSelectedIndex

The method I am trying to access this is through - this.Page on the OnLoad even of the Control

View 6 Replies

Custom Server Controls :: Create A Dropdown List Of Selectable Properties In A User Control?

Dec 3, 2009

I have developed a user control that has a boolean property. In the VisualStudio properties window I would like to have one of those little drop-down lists with the words True and False that would set the value in the {set} code to a boolean true or false. How do I do that? How would I set a drop-down list of text items for a string property.I know how to set the properties from the properties window...I just want to know how to display the list of selectable items.

View 3 Replies

Custom Server Controls :: Accessing Properties Of A User Control From The Inherited Code Page?

Mar 8, 2010

If the answer to this question exists somewhere, I'm no good at searching for it. This is sort of a simple question, the response being two parts: (1) is it possible? (2) if so, how?

I've created a web user control for my site's footer. In my web.config I have it registered like this:


Then, within the pages on my site, I simply insert it like this:


But obviously, that didn't work. I get this error: The type or namespace name 'FooterControl' could not be found (are you missing a using directive or an assembly reference?)

So I'm really not sure what to do at this point. I can put all of my code in the ASPX file and make my life easier, but I would kind of prefer not to.

View 11 Replies

Web Forms :: Databinding A ListView To An Objects Properties?

Nov 17, 2009

I'm making a web project.

I have a ListView that I want to databind to a object that contains 4 properties with values like; firstname, age etc.

I purpose with this is to make the ListView show the values of the properties.

View 4 Replies

Dynamic Data Be Made To Work With Custom Business Objects Rather Than Data Objects?

Feb 24, 2010

I'm working on a project in which we have a database, data layer (entity framework), business layer and web/UI layer.I want to use ASP.NET Dynamic Data for the web layer, but don't want it to access the data layer or database, as I want it to be purely running off business logic, and not directly accessing the data.However, it appears that Dynamic Data only allows Linq-to-SQL or entity framework data sources to be used.Has anyone used it with business-layer objects instead?

View 1 Replies

How To Bind Form Collection Back To Custom Model Object That Uses 2 Custom Objects

Mar 23, 2010

What I'm trying to do is rather basic, but I might have my facts mixed up. I have a details page that has a custom class as it's Model. The custom class uses 2 custom objects with yet another custom object a property of one of the 2. The details page outputs a fair amount of information, but allows the user to post a comment. When the user clicks the post button, the page gets posted to a Details action that looks something like this:

public ActionResult Details(VideoDetailModel vidAndComment) { ....}

The only fields on the form that is posted are CommentText and VideoId. Here is what the VideoDetailModel looks like.

public class VideoDetailModel
public VideoDetailModel()
I suppose if I added more form fields for the properties I need, they would get posted, but I only need 1 form entry field for the CommentText. If I could get the same Model objects value that were sent to the page to post with the page, it looks like the solution is rather simple. I think using the RenderPartial in the middle of a form is problematic somehow to how the form gets written in html. I can't really put my finger on why things went bonkers, but if I do my RenderPartials before my form and then begin my form with the text entry field and the hidden VideoId, the default ModelBinder works just fine. I was beginning the form, writing the hidden VideoId, rendering several partial views, create my CommentText field, and then closed the form out. The CommentText field would get bound just fine. The hidden VideoId would not. Maybe I missed a rule somewhere about using RenderPartial.

For completeness, the partial view I was rendering took a Comment object and just wrote out it's CommentText data. Several of these objects would exist for a single Video object. All of this data was in a custom type and passed into the View (the main view) as it's Model. This partial view did not have a form and did not have any data entry fields.

View 2 Replies

Custom Server Controls :: Access Properties Of Custom WebControl In ASPX Codebehind File?

Jul 19, 2009

I have created a custom control that derives from WebControl class. I have defined a property called "ItemCount" in the custom control.

This custom control is created as a separate project and the assembly is added to the main web project (VS 2005 Web Site).

Just to test, I have only one line writer.Write("Hello World!") in the overriden "RenderContents" method in the web control.

Once added to the aspx file, the control renders the text perfectly fine and is declared in the aspx file as

<cc:mycontrol ID="_testControl" runat="server"/>

Now, when I try to access the control "_testControl" in the codebehind, I cannot compile and I get the error as "The name '_testControl' does not exist in current context.

After reading multiple posts, I tried declaring the control in my aspx codebehind as

protected MYControl _testControl;

This comes out to be NULL during run-time. I'm not too familiar with, but if other controls (e.g. Button, Textbox) are accessible in my codebehind including their properties, should the same logic be not applied to WebControls...they are all the same!

I can create a new instance of the _testControl in the OnInit method, but that defeats the whole purpose. I need to understand what is going on and what is the right way to solve it.

View 1 Replies

Custom Server Controls :: How To Get The Value Of Readonly Properties Of Server Controls Inside A Custom Server Control

Apr 4, 2010

I have a custom server control inheriting from CompositeControl. It consists of two RadioButtonlist controls that are rendered side by side in an html table. The number of ListItems in each RadioButtonList is not known until runtime. Depending on how many items each list contains, the RepeatColumns property of each list is set differently. To do this in the handler for the ItemDataBound event I need to get the count of ListItems in each RadioButtonList. How do I expose the Items.Count property of each internal RadioButtonList as a top-level property? I tried using a getter to return the count but this generates a compile-time error to the effect that the count cannot be assigned to--even though I have not created a setter.

Similarly, in the handler for the Submit event, I need to get the ClientID of each internal RadioButtonList to pass to a method that checks for data changes. How do I expose the ClientID of each component RadioButtonList as a top-level property?

I can of course index the Controls collection of the composite control to access the child control and read its properties--but that defeats the whole point of making a complex, independent custom server control.

View 1 Replies

Creating Custom Objects For Wcf?

Oct 2, 2010

I have an existing web application that uses EF and POCO objects. I want to improve the client experience by exposing some of my objects through WCF(JSON). I have this working fine but where I am unsure is how to handle derived objects(not sure if that is the correct term) or IEnumerable anonymous objects if you will.

Let's say I have 3 tables structured like so:







This is obviously a one-to-many type relationship. I have my navigation properties setup correctly and getting strongly typed object properties works great. However, how do I send serialized anonymous type object(s) over the wire. Like an object that sends all instances that are equal to groupid=1 and include the names of the template and the object.Am I missing something or do I have to create another class object for WCF that would look like this:

WCF Object


I guess I could alter my tables to account for this but that seems wrong too. I know that IEnumerable objects can't be serialized and I know that throw away objects are probably not the way to go either. I want to do this the right way but I am not sure how to go about it.

View 1 Replies

AJAX :: Custom Objects In JS?

Nov 20, 2006

Ive seen in some examples a way of creating a CS / VB.NET object in javascript and passing that objects to your webmethods?

View 7 Replies

$.ajax(..) And Passing Custom Objects By Ref?

Dec 10, 2010

How to use $.ajax(..) JSON to invoke asmx webmethods that have 'by ref arguments' for custom classes/objects? Is it possible?

My c# code -
public class MyCustomClass{ public int MyProperty; MyCustomClass(){}}
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public Method1(ref MyCustomClass MyCustomObj)


This all works fine if the webmethod's argument is NOT by ref.With the above mentioned signature of the webmethod, i.e. with a by ref argument, I get a server error (in server response seen using firebub ) -

View 1 Replies

Copyrights 2005-15, All rights reserved