Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > New Property

Reply
Thread Tools

New Property

 
 
=?Utf-8?B?RGVtZXRyaQ==?=
Guest
Posts: n/a
 
      10-13-2004
Hi,

I have created my own textbox class in order to implement some functionality
that it does not already have (it inherits the TextBox webcontrol class). In
addition, I would like to create a new property for it. Here is my problem:

TextBox server controls get rendered as input tags on client side. I have a
popup window that will need to reference the parent window's textbox (input)
and set a property that I can reference when the page does a postback from
other user interaction later.

Any idea how to implement a property that can be referenced both on client
and server side of a server control?

-Demetri
 
Reply With Quote
 
 
 
 
A Traveler
Guest
Posts: n/a
 
      10-14-2004
What i would probably do, from what i read in your post, is create your
server-side code as

Public Property MyNewProperty() As String
Get
Return MyBase.Attributes("mynewproperty")
End Get
Set(Value As String)
MyBase.Attributes("mynewproperty") = Value
End Set
End Property

In your controls constructor, also add a line
MyBase.Attributes.Add("mynewproperty","mydefaultva lue")

In client side script, you can access it by:
myClientID.getAttribute and myClientID.setAttribute functions.
See the javascript docs for those.

HTH.


"Demetri" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have created my own textbox class in order to implement some
> functionality
> that it does not already have (it inherits the TextBox webcontrol class).
> In
> addition, I would like to create a new property for it. Here is my
> problem:
>
> TextBox server controls get rendered as input tags on client side. I have
> a
> popup window that will need to reference the parent window's textbox
> (input)
> and set a property that I can reference when the page does a postback from
> other user interaction later.
>
> Any idea how to implement a property that can be referenced both on client
> and server side of a server control?
>
> -Demetri



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding to property of property of object collection TS ASP .Net 3 08-31-2006 12:57 PM
TableCell: BackColor Property But No BackGround Property? Nathan Sokalski ASP .Net 1 04-29-2006 10:09 PM
DataBinder.Eval for an object's property property... like Eval(Container.DataItem,"Version.Major") Eric Newton ASP .Net 3 04-04-2005 10:11 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM



Advertisments