Custom Webcontrols, VS EDI support and intellisense?

Discussion in 'ASP .Net Building Controls' started by Peter Lykkegaard, Aug 8, 2004.

  1. Hi All

    I have been working on some custom webcontrols. Among other things I
    have extended the datagrid with a few things
    Everything is working perfectly nice and smooth

    But how on earth do I add xsd schemas for intellisense etc?

    My webcontrols is in the namespace: Project.Web.UI.WebControls
    I have compiled an xsd file using the generator from BlueVisionSoftWare
    This file is saved in the same xml folder as asp.xsd

    I have a targetnamespace in my xsd:
    urn:http://schemas.myself.com/project"

    I have a tag for my own controls called eg "projweb"

    In my asx file I have included a reference for the xsd file in the body
    tag
    <body xmlns:projweb="urn:http://schemas.myself.com/project">

    Problems
    a)
    I need to add xtra attr in the body tag like id="myBody" and
    runat="server"

    I get a parser error:
    "The server tag is not well formed"
    Highlighting the line with the body tag

    If I remove the runat="server" attr everything is fine but my code
    breaks as I am adding/removing clientside JavaScript during postbacks
    Eg
    Me.myBody.Attributes.Remove("onLoad")

    This line is highlighted with an error:
    "System.NullReferenceException: Object reference not set to an instance
    of an object"

    That should be pretty obvious

    Maybe I need to rewrite this?
    Other solutions?

    b)
    Normally you would have the columns tag followed by a number of
    boundcolumns
    Eg

    <columns>
    <asp:boundcolumn DataField="KeyField"
    HeaderText="SomeKey"></asp:boundcolumn>

    Intellisense doesn't like this for my new datagrid (it compiles and runs
    just fine)
    I have tried to change this to eg

    <columns>
    <projweb:boundcolumn DataField="KeyField"
    HeaderText="SomeKey"></projweb:boundcolumn>

    Intellisense says ok
    But the parser complains:
    "Could not load type Project.Web.UI.WebControls.boundcolumn from
    assembly Project.Web"

    Maybe an error int xsd file?
    Any suggestions?
    Other than wait for VS 2005 before I add intellisense?

    tia/Peter
     
    Peter Lykkegaard, Aug 8, 2004
    #1
    1. Advertisements

  2. Peter Lykkegaard

    Teemu Keiski Guest

    Teemu Keiski, Aug 9, 2004
    #2
    1. Advertisements

  3. Thanks for Teemu's informative resources:

    Hi Peter,

    Here is a tech article discussing on adding design-time support (including
    html source intellisense ) for asp.net web control:

    #Adding Design-Time Support to ASP.NET Controls
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
    /ASPNet-AddDesignTimeSupport.asp

    Hope also helpful!

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Aug 9, 2004
    #3
  4. Sorry I was not quite clear on that point
    I am actually using the Intellisense Generator allthough I do experience
    some glitches as the generated XSD is far from perfect
    Might be ok with more simple controls than the datagrid, as a lot of
    people is using this tool :)

    Thanks for your reply though :)

    - Peter
     
    Peter Lykkegaard, Aug 9, 2004
    #4
  5. Yep I have read the article, from the original source though
    Quite nice :)

    I think I will start a small test project based on the blog sample, just
    to examine if everything is put in the right place
    Hopefully Whidbey will be just a little better at this :)

    It is a rather small issue and just nice to have, but at the same time
    quite frustrating :)

    Thanks for the link

    - Peter
     
    Peter Lykkegaard, Aug 9, 2004
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.