Add A Custom Property In A File In .Net ?

Nov 29, 2010

There are some .txt, doc and other extension type of files in a folder now i want to add custom properties on all file how to do it ? there are already some attribute like Location, Size, Size on Disk, created on , modify on so i want to add another property like "version".

View 1 Replies


Similar Messages:

Web Forms :: How To Expose User Control Custom Property At Its Code Behind File

Mar 10, 2010

I created a simple gridview user control with a custom property ProfileType which should load different records depending on the ProfileType value when attaching to a web page.

This is my web page:

[code]....

how I can expose user control custom property at its code-behind file.

View 2 Replies

Custom Server Controls :: Binding UserControl Property To Page Property?

Sep 15, 2010

So what I'm trying to accomplish is this

[Code]....

The user control has public properties named accordingly and the page has protected properties accordingly which I've verified have the desired values.

For some reason the values are always empty strings or 0s in the usercontrol, no matter what the page property is.

View 1 Replies

Custom Server Controls :: Insert A Drop List Property Into A Custom Webcontrol?

Feb 18, 2010

How insert a drop list property into a custom webcontrol? This a drop list property is show all textbox control on usercontrol or webpage.

View 3 Replies

Custom Server Controls :: Custom Checkbox Control 'checked' Property Is Not Working?

Sep 3, 2010

Iam developing a custom checkbox control deriving from the 'compositecontrol' which i need to use it for a composite control purpose.

public
class
TngCheckBox :
CompositeControl
{

i have written the required properties which are working fine except the "checked" property. here is my code for 'checked' property. i tried both the below ways (commented one and not commneted) . the problem is the 'checked' value is not setting the value at the get set part of the property.its assigning the value at the design time , but when i check and uncheck its not updating the property value.which is resulting me wrong .

[Code]....

View 2 Replies

Custom Server Controls :: Custom Checkbox Control 'checked' Property Is Not Working ?

Oct 15, 2010

Iam developing a custom checkbox control deriving from the 'compositecontrol' which i need to use it for a composite control purpose.

public
class
TngCheckBox :
CompositeControl
{

i have written the required properties which are working fine except the "checked" property. here is my code for 'checked' property. i tried both the below ways (commented one and not commneted) . the problem is the 'checked' value is not setting the value at the get set part of the property.its assigning the value at the design time , but when i check and uncheck its not updating the property value.which is resulting me wrong .

[Code]....

View 4 Replies

Custom Server Controls :: List Property Of A Custom Control Is Not Persisted?

Mar 15, 2010

I have a custom control, inherited from Button. This is the class definition for the control and 2 properties:

[Code]....

I show you 2 properties, only to illustrate the problem.

as you see Aplicacion property is of a custom type Sistema, and Roles property is of type List<UserRol>.

The Aplicacion property is rendered well, this way:

[Code]....

The problem I have is with List<UserRol>. I couldn't get it to be rendered. I expeect to be rendered this way:

[Code]....

Finally, this is the TypeConverter and Editor definitions for the list:

[Code]....


The UserRol class is a typical class, without any special attributes.

I have discovered that when I use the custom editor for Roles property, the collection is not persisted. When I use the default editor for the collection, the collection is persisted.

View 1 Replies

Custom Server Controls :: Need Custom Text Box Control With DataSource,TableName,ColumnName Property?

Nov 26, 2010

I need to create one custom text box control which should be bind with data base.

I am referring following link...

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.databoundcontrol.aspx

I used DataBoundControl to create my control but i am not able to do it properly.

public class SimpleTextBoxControl : DataBoundControl
{
private TextBox nameTextBox;
public string DataTextField
{
get
{
object o = ViewState["DataTextField"];
return ((o == null) ? string.Empty : (string)o);
}
set
{
ViewState["DataTextField"] = value;
}
}
[
Bindable(true),
Category("Data"),
DefaultValue(""),
Description("The text to display on the link."),
Localizable(true),
PersistenceMode(PersistenceMode.InnerDefaultProperty)
]
public virtual string DataTexValue
{
get
{
string s = (string)ViewState["Text"];
return (s == null) ? String.Empty : s;
}
set
{
ViewState["Text"] = value;
}
}
protected override void PerformDataBinding(IEnumerable retrievedData)
{
if (retrievedData == null)
return;
base.PerformDataBinding(retrievedData);
Controls.Clear();
nameTextBox = new TextBox { ID = "nameTextBox" };
foreach (object dataItem in retrievedData)
{
if (DataTextField.Length > 0)
{
nameTextBox.Text = DataBinder.GetPropertyValue(dataItem, DataTextField, null);
}
DataTexValue = nameTextBox.Text;
}
this.Controls.Add(nameTextBox);
}
}

View 1 Replies

Custom Server Controls :: How To Create Custom Property (DataSource) In Custom Controls

May 15, 2010

I know that how to create custom control and add custom property.

I want to create property like DataSource to my custom control.

View 1 Replies

Add Custom Property To Custom Server Control?

Jan 11, 2011

I have created an asp.net custom control and now want to pass some values to it from the page which will use the control.Is there any way i can add my own property to the control (like Text property is present for a Label control)?

View 4 Replies

Custom Server Controls :: How To Add A Dropdownlist Of Available Values For A Custom Server Control Property

Sep 13, 2010

How would I add a (dropdown) list of available values for a custom server control property?

(Just like 'Visible' property of most controls has valid values of 'True/False' and nothing else can be entered or selected)

View 3 Replies

Accessing Property Value Of A Custom Control By Another Custom Control In Design-time

Oct 18, 2010

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.

View 4 Replies

Custom Server Controls :: How To Custom Controls Derived From Existing Controls - Overriding Default Property Values

Nov 15, 2010

I have some (probably very basic) questions about developing custom controls. I am wanting to derive a set of button controls, and the first one I have started on is a "DeleteButton", that has a additional property (DeleteConfirmationText) that is built into the OnClientClick attribute. To get that added, I overrode the Render method as follows:

[Code]....

This all works well. Now, I will add some logic to make sure that there is some text in the DeleteConfirmationText property, but that isn't the intent of my question.
What I am also wanting to do is to override some of the default property values, so I added that to the default constructor:

[Code]....

Now, in the designer in VS2008, and I look at the properties for the control, there isn't a default value shown in the "Properties" section, and the Causesvalidation still shows the underlying classes default value of "True". As well, in design mode, where the GridView control that containse my DeleteButton control would be displayed, there is an error box "There was an error rendering the control. 'Are you certain you want to delete this attorney?' cound not be set on property 'DeleteConfirmationText'. Here's the markup where I am defining the deletebutton control:

[Code]....

What am I doing wrong?

View 5 Replies

Visual Studio :: Connection Property Error The Connection Property In The Web.config File Is Missing Or Incorrect In VWD 2010?

Apr 18, 2010

When I open an ASP.NET 3.5 project using VWD2010, I get a prompt error message,"The connection property in the web.config file is missing or incorrect.The connection string from the .dbml file has been used in its place."however, my project works successfully.

View 1 Replies

Unable To Set A Property On A Custom Dropdownlist

Oct 26, 2010

I'm trying to set a property on a custom DropDownList:

<custom:ReferenceDropDownList ... ValidityDate="<%# Application.CreateDate %>" />

Even though I can see that Application.CreateDate has been set in the Page_Load method on the containing UserControl, the code-behind in the DDL never seems to pick it up.

protected override void OnLoad(EventArgs e)
{
// this.ValidityDate is always null
}

This is even the case with ValidityDate="<%# DateTime.Now %>". The property of the DDL is declared like this:

[Category("Data")]
[DefaultValue(null)]
public DateTime? ValidityDate { get; set; }

what is the correct sequence I should be following here. I thought that a DDL would evaluate a cynamic property value like that without too much trouble.

View 1 Replies

How To Get Custom Property From Textbox Using Javascript

Mar 26, 2010

I have created a custom text box with property "key"(ASP.NET C#).I want to get the value of this property "key" using java script.How can I do this?

View 2 Replies

How To Add A Default Value To A Custom Profile Property

Jun 16, 2010

I know you can add defaultValues using the web.config like this:

<profile>
<properties>
<add name="AreCool" type="System.Boolean" defaultValue="False" />
</properties>
</profile>

but I have the Profile inherited from a class:

<profile inherits="CustomProfile" defaultProvider="CustomProfileProvider" enabled="true">
<providers>
<clear />
<add name="CustomProfileProvider" type="CustomProfileProvider" />
</providers>
</profile>

Heres the class:

Public Class CustomProfile
Inherits ProfileBase
Public Property AreCool() As Boolean
Get
Return Me.GetPropertyValue("AreCool")
End Get
Set(ByVal value As Boolean)
Me.SetPropertyValue("AreCool", value)
End Set
End Property
End Class

I don't know how to set the default value of the property. Its causing errors because without a default value, it uses an empty string, which cannot be converted to a Boolean. I tried adding <DefaultSettingValue("False")> _ but that didn't seem to make a difference.

I'm also using a custom ProfileProvider (CustomProfileProvider).

View 2 Replies

C# - Get Property's Display Name From A Custom Attribute?

Nov 7, 2010

I am trying to create a minimum length validation attribute which will force users to enter the specified minimum amount of characters into a textbox

public sealed class MinimumLengthAttribute : ValidationAttribute
{
public int MinLength { get; set; }
public MinimumLengthAttribute(int minLength)
{
MinLength = minLength;
}
public override bool IsValid(object value)
{
if (value == null)
{
return true;
}
string valueAsString = value as string;
return (valueAsString != null && valueAsString.Length >= MinLength);
}
}

In the constructor of the MinimumLengthAttribute I would like to set the error message as follows:

ErrorMessage = "{0} must be atleast {1} characters long"

How can I get the property's display name so that I can populate the {0} placeholder?

View 1 Replies

Custom Validator For MaxLength Property Of Textarea

May 16, 2010

I have quite a few text area's on my page and am wanting to limit the number of characters for each one. However each one should be able to have its own maxlength (i.e. one could be 20 characters and the other could be 100 characters). My validation on the page is all done using custom validation as the built in validation of .NET is not extensible enough for me to display my validation errors how I want to display them. So this is what im wanting to do:

Make a custom validatorPass a MaxLength value from the custom validator into the javascript function, this value must also be accessible from the code behindI can then run client side and server side validation on each textbox control. The problem I am having is passing a MaxLength value to client side script and to server side. Is there a property on custom validators which I can use to pass values around? For instance in Javascript I would want the value of the MaxLength and also the id of the Div which will show the characters remaining, and server side I would need to know the MaxLength. I have done lots of research on this and cannot seem to find an answer.

View 8 Replies

Web Forms :: Modify Property From Custom Control

Sep 29, 2010

I'm trying to do something which to me seems like it should be simple, yet I cannot think of a simple way to do it.

I have a built custom control, that has a property I want to change based on a user's interaction with a second custom control. This second control will be a table of data, with an 'edit' link in the last column. I would like the control, when the edit link is pressed, to pass an ID and trigger some event so that I can assign this ID to the first control. My initial technique for building this (second) control was to create some code which will iteratively create some html based on a dynamic range of data selected by the user. I know that I could create some sort of link with a value in the query string, but I would like to implement AJAX and was hoping that I could enable this communication without changing the URL.

View 1 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

Custom Server Controls :: How To Set And Get Property For The Dropdown

Jul 21, 2010

In my user control i have the label1,textbox1 and dropdown1, i can able to set the values and get for both label and text box. but how can i set the value for the drop down.

from the aspx.cs or aspx.vb

i will set the object of the control (Ex: usercontrol1234)

usercontrol1234.propText="This is text box"
usercontrol1234.propLbl="This is Label "

Then how can i set for the drop down? i can bind the dropdown data either by dataset or datareader.But cannot able to figure out how to set the property?

[code]....

View 7 Replies

Databind A Property On A Custom User Control?

Nov 29, 2010

I have a custom user control UserProfileLink on which I have two basic string properties, UID and UserFullName which I would like to use in a template column in a DataGrid like this:

....
<ItemTemplate>
<td:UserProfileLink ID="uplUser" runat="server" UID="<%#Eval("UserUID") %>" UserFullName="<%#Eval("UserFullName") %>" />
</ItemTemplate>
....

I get an error saying "The server tag is not well formed" which leads me to believe this type of binding isn't possible. Is there a way to do this, or is it impossible?

View 1 Replies

Javascript - RequiredFieldValidator Custom EvaluationFunction Property?

Nov 28, 2010

My custom ASP.Net RequiredFieldValidator renders markup like this...

var af1_ctl00 = document.all ? document.all["af1_ctl00"] : document.getElementById("af1_ctl00");
af1_ctl00.controltovalidate = "af1_af1_txt";
af1_ctl00.display = "None";
af1_ctl00.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
af1_ctl00.initialvalue = "";

However, there appears to be no way to set the evaluationfunction property. I need to do this to call some custom script.Ive tried the following methods.Adding a new attribute when the control is rendered and when the attributes are rendered Calling RemoveAttribute followed by Attributes.Add Attempting to reset it via javascript.Nothing seems to work.If I can get a solution that works in the c# code to set the attribute before render that would be the best for what Im doing.

View 1 Replies

C# - Adding A Custom Property To Entity Framework?

Oct 19, 2010

I am using the Entity Framework for the first time and want to know if the following is possible - I have generated my classes from the DB, and have one called Category.

Obviously it has all my fields in the table (ID, CategoryName, SortOrder etc..) but I want to know if I can add a custom property which is not in the table, but is actually the result of a custom method.

I want to add a new property called 'CategoryURL' which is basically the 'CategoryName' property run through a custom method and returns a hyphenated string.

My initial thought is inheriting from the generated Category class and creating something like this inside?

public string CategoryURL
{
get{ return MyCustomMethod(this.CategoryName) }
}

Is this the correct approach? And will 'this.CategoryName' work as I think it should? Basically the end result is when I return a list of 'Category' I want this to be part of the class so I can use it in my foreach loop.

View 1 Replies







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