Properties loosing their values, and TagPrefix

M

Mark Norgate

Hi

I have a couple of problems that I've been unable to solve, so I'm asking
once more for help.

The properties that I've added to my own control are being reset just before
the application launches. I've added an InnerHtml property like this:

[Bindable(true), Category("Appearance")]
public string InnerHtml {
get {
object o = ViewState["InnerHtml"];
if( o!=null )
return o.ToString();
else
return "";
}
set {
ViewState["InnerHtml"] = value;
}
}

Trouble is, as I say, any values I added to this in the designer are
immediately set to blank immediately before the application launches in
debug mode. Anyone have any idea why this might be?

Secondly, the TagPrefix I'm setting up is not being used on my pages, but
the default cc1 is being used. My class is called XhtmlControl, and in the
AssemblyInfo.cs of my control assembly I have:

[assembly: TagPrefix("XhtmlControl", "Refresh")]

I've tried rebuilding and resetting the toolbox, but still it gets ignored.
Any ideas why?

Incidentally, when adding controls to the toolbox, do we add the .dll from
the obj or the bin folder?

Cheers, Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top