Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
J

Jurgen Muller jmse

@Jurgen Muller jmse
About
Posts
7
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • custom server control problem
    J Jurgen Muller jmse

    Hi,

    minhpc_bk wrote:

    + Do you get the error right after you add the control onto the web page or after you do something and the error occurs?

    the error occurs right after adding the control

    minhpc_bk wrote:

    + If you manually add the custom component in the source view and switch back to the Design view, do you still get the error?

    as I wrote, if I open the WebForm with designer all MyComponent controls on that WebForm are displayed without error; so adding controls in the source is OK

    minhpc_bk wrote:

    + Do you plan to use the MyComponent with the MultiView control?

    yes, MyComponent is used in a MutliView

    ASP.NET help csharp visual-studio sysadmin debugging

  • custom server control problem
    J Jurgen Muller jmse

    Hi, thanks again for your help. I've tried your code and the component works fine. No errors; all casts are OK. I've added my component to the same test project and again the error occurs. What I found out: the error only occurs when the component is added from the toolbox to a WebForm (regardless of added by doubleclick or dragged with the mouse). When the WebForm is closed and opened again in the designer, all of my components are processed without error. My component and the designer are in an extra WebLibraray project. For debugging I use two instances of VS 2005. The complete declaration of my component: [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), ToolboxData("<{0}:MyComponent runat=\"server\"> "), ToolboxBitmap(typeof(MyComponent), "MyComponent.bmp"), Designer(typeof(MyComponentDesigner)), ParseChildren(false), PersistChildren(true) ] public class MyComponent: View, INamingContainer Any idaes? Regards Jürgen -- modified at 4:25 Thursday 31st August, 2006

    ASP.NET help csharp visual-studio sysadmin debugging

  • loading temporary asp.net files takes ages [modified]
    J Jurgen Muller jmse

    Hi, Magnus. ...maybe your harddisk is broken. I've had the similar behaviour some time ago (but with another app), and it turned out the harddisk was the problem. Regards Jürgen

    ASP.NET question csharp asp-net debugging help

  • custom server control problem
    J Jurgen Muller jmse

    Hi, I've tried what you mentioned: public override void Initialize(IComponent component) { base.Initialize(component); try { MyComponent o = (MyComponent)component; } catch (Exception ex) { string s = ex.Message; } } - Exception: Unable to cast object of type 'jmse.WebControls.MyComponent' to type 'jmse.WebControls.MyComponent'. - InnerException is null - the declaration of MyComponent: public class MyComponent : View, INamingContainer - I've modified the source but still have the same effect; declaration of the designer: public class MyComponentDesigner : ViewDesigner - MyComponent is placed on a MultiView

    ASP.NET help csharp visual-studio sysadmin debugging

  • custom server control problem
    J Jurgen Muller jmse

    Hi, John. Thank you for the link. I've found this already and unfortunately it didn't help me. I think the ContainerControlDesigner is the right pick. VS help says: "(ContainerControlDesigner) provides designer functionality for controls that contain child controls or properties that can be modified at design time." Controls placed on MyComponent are designed by their own designer... Regards Jürgen

    ASP.NET help csharp visual-studio sysadmin debugging

  • custom server control problem
    J Jurgen Muller jmse

    Hi, John. Thanks for your answer. A typesafe cast will not throw the exception, that's right. But nevertheless my designer will not work. And: the type is correct. I even used the full qualified class name to be sure. When I log a message printing the typename it's ok, too. Very strange behaviour... Have you (or somebody else) written a designer which works well? Regards Jürgen

    ASP.NET help csharp visual-studio sysadmin debugging

  • custom server control problem
    J Jurgen Muller jmse

    Hi, all. I'm having a strange problem while writing custom server control. The control works fine so far, but I wanted to add some features which support the developer while using the control in the Visual Studio designer. Therefore I've added a designer which extends ContainerControlDesigner... Code fragment: public class MyDesigner : ContainerControlDesigner { public override string FrameCaption { get { MyComponent c = (MyComponent)base.Component; return "MyComponent - " + c.MyProperty; } } Problem: Sometimes the cast MyComponent c = (MyComponent)base.Component will throw an exception - and sometimes not. I haven't found a reason for this. The type of base.Component is MyComponent. I've checked this in the debugger. Even Visual Studio shows me all properties of this type during debugging. I've modified the code and read the value of c.MyProperty via reflection - and it works... Any ideas what might be wrong or what happens here? :confused: Any help appreciated. Regards Jürgen Stuttgart Germany

    ASP.NET help csharp visual-studio sysadmin debugging
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups