Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Property Extender properties not persisting !

Reply
Thread Tools

Property Extender properties not persisting !

 
 
JezB
Guest
Posts: n/a
 
      06-22-2004
I've written an extender provider for windows forms controls and ASP.NET web
controls. My windows forms solution works fine, but my ASP.NET solution does
not persist any property values I enter via the visual studio property grid.

Upon examination of the code within InitializeComponent I can see why : no
code is automatically embedded to call the Set method of my property.

Anyone have any ideas why ? Is there any solution ?

__________________________________________________ __________________
using System;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;
using System.Web.UI.WebControls;
namespace WorkPlace.Presentation.WebLib
{
[ProvideProperty("Key",typeof(WebControl))]
public class FlavourPropertiesExtender :
System.ComponentModel.Component,
IExtenderProvider
{
private System.ComponentModel.Container components = null;
private Hashtable keys;
public FlavourPropertiesExtender(System.ComponentModel.IC ontainer
container)
{
container.Add(this);
InitializeComponent();
}

public FlavourPropertiesExtender()
{
keys = new Hashtable();
}

[Category("Key Configuration")]
public string GetKey(WebControl c)
{
string text = (string)keys[c];
if (text == null)
{
text = c.ID;
}
return text;
}
public void SetKey(WebControl c, string value)
{
if (value == null)
value = string.Empty;
if (value.Length == 0)
keys.Remove(c);
else
keys[c] = value;
}

#region Component Designer generated code
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion

#region IExtenderProvider Members
public bool CanExtend(object extendee)
{
return (extendee is WebControl);
}
#endregion
}
}


 
Reply With Quote
 
 
 
 
Garry McGlennon
Guest
Posts: n/a
 
      06-24-2004
I'm not sure but it looks like you have a similar issue to me... The URL i
posted in my request for help tackles it a different way. I can get it to
persist Ok, but it won't set itself correctly.

Anyway, check out my recently posted message as it 'might' give you some
idea's.

Oh btw, in ASP.NET it stores property values in the HTML not the page like
it does with WinForms, so you should see attributes in your HTML for the
properties (its so late bound!).

Garry Mc

"JezB" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I've written an extender provider for windows forms controls and ASP.NET

web
> controls. My windows forms solution works fine, but my ASP.NET solution

does
> not persist any property values I enter via the visual studio property

grid.
>
> Upon examination of the code within InitializeComponent I can see why : no
> code is automatically embedded to call the Set method of my property.
>
> Anyone have any ideas why ? Is there any solution ?
>



 
Reply With Quote
 
 
 
 
JezB
Guest
Posts: n/a
 
      06-24-2004
ok thanks - i'll take a look

"Garry McGlennon" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I'm not sure but it looks like you have a similar issue to me... The URL i
> posted in my request for help tackles it a different way. I can get it to
> persist Ok, but it won't set itself correctly.
>
> Anyway, check out my recently posted message as it 'might' give you some
> idea's.
>
> Oh btw, in ASP.NET it stores property values in the HTML not the page like
> it does with WinForms, so you should see attributes in your HTML for the
> properties (its so late bound!).
>
> Garry Mc
>
> "JezB" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > I've written an extender provider for windows forms controls and ASP.NET

> web
> > controls. My windows forms solution works fine, but my ASP.NET solution

> does
> > not persist any property values I enter via the visual studio property

> grid.
> >
> > Upon examination of the code within InitializeComponent I can see why :

no
> > code is automatically embedded to call the Set method of my property.
> >
> > Anyone have any ideas why ? Is there any solution ?
> >

>
>



 
Reply With Quote
 
dotnet_vb_newbie@programmer.net
Guest
Posts: n/a
 
      11-04-2004
Gary -

I'm having an issue with persistence in a webform provider. I'm
wondering if it sounds like the same problem you had. I've added some
add'l properties to textBox webcontrols. The properies show up and can
be set in the designer. However, if I run the aspx page through the
web, all the new attribute settings disappear.

Another way this shows up is if you set the property values in the
designer, save/close the aspx page and then reopen the aspx page, all
the property values are reset to default.

If this is the same problem, how did you resolve it? It seems really
strange how little info is out there reguarding webcontrol providers...

Garry McGlennon wrote:
> I'm not sure but it looks like you have a similar issue to me... The

URL i
> posted in my request for help tackles it a different way. I can get

it to
> persist Ok, but it won't set itself correctly.
>
> Anyway, check out my recently posted message as it 'might' give you

some
> idea's.
>
> Oh btw, in ASP.NET it stores property values in the HTML not the page

like
> it does with WinForms, so you should see attributes in your HTML for

the
> properties (its so late bound!).
>
> Garry Mc
>
> "JezB" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > I've written an extender provider for windows forms controls and

ASP.NET
> web
> > controls. My windows forms solution works fine, but my ASP.NET

solution
> does
> > not persist any property values I enter via the visual studio

property
> grid.
> >
> > Upon examination of the code within InitializeComponent I can see

why : no
> > code is automatically embedded to call the Set method of my

property.
> >
> > Anyone have any ideas why ? Is there any solution ?
> >


 
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
Values not persisting in extender provider *no spam* ASP .Net Building Controls 5 10-31-2004 12:47 PM
Persisting properties in property Grid (help!) Garry McGlennon ASP .Net Web Controls 0 06-24-2004 06:50 AM
extender provider properties not persisting ! JezB ASP .Net 1 06-22-2004 10:04 AM
Complex properties (Button) not persisting in webcontrol Phillyboy123 ASP .Net Building Controls 1 01-15-2004 07:55 PM
Persisting properties in templates and not the control itself Alessandro Zifiglio ASP .Net Building Controls 0 11-09-2003 11:31 AM



Advertisments