mystery!

Discussion in 'ASP .Net' started by Lloyd Dupont, Jan 11, 2006.

  1. Lloyd Dupont

    Lloyd Dupont Guest

    I have a Control like that
    ===
    public class BlogMonthList : Control, IPostBackEventHandler
    {
    protected override void Render(HtmlTextWriter writer)
    {
    writer.WriteLine(" <a href=\"{0}\">{1}</a><br/>",
    Page.ClientScript.GetPostBackClientHyperlink(this, "addblog"),
    strings.AddBlog);
    }
    public void RaisePostBackEvent(string eventArgument)
    {
    switch (eventArgument)
    {
    case "addblog":
    // do something
    break;
    }
    }
    }
    ===
    Now I have a breakpoint in RaisePostBack(), when I click the link, RaisePostBack is never called.
    How could that be?
    Is there some extra steps I have been missing?

    --
    I have taken a vow of poverty. If you want to really piss me off, send me money.
    Lloyd Dupont, Jan 11, 2006
    #1
    1. Advertising

  2. Lloyd Dupont

    Lloyd Dupont Guest

    BTW I have check if I don't mess up with control ID, but the Control's id is the same at each query or postback....
    "Lloyd Dupont" <net.galador@ld> wrote in message news:...
    I have a Control like that
    ===
    public class BlogMonthList : Control, IPostBackEventHandler
    {
    protected override void Render(HtmlTextWriter writer)
    {
    writer.WriteLine(" <a href=\"{0}\">{1}</a><br/>",
    Page.ClientScript.GetPostBackClientHyperlink(this, "addblog"),
    strings.AddBlog);
    }
    public void RaisePostBackEvent(string eventArgument)
    {
    switch (eventArgument)
    {
    case "addblog":
    // do something
    break;
    }
    }
    }
    ===
    Now I have a breakpoint in RaisePostBack(), when I click the link, RaisePostBack is never called.
    How could that be?
    Is there some extra steps I have been missing?

    --
    I have taken a vow of poverty. If you want to really piss me off, send me money.
    Lloyd Dupont, Jan 11, 2006
    #2
    1. Advertising

  3. Lloyd Dupont

    Lloyd Dupont Guest

    This Hyperlink is in a UserControl of my owne creation (in C# code).
    If I create the hyperlink outside the box it works.

    Now I have followed all the steps to correctly create my container control... mysterious...
    "Lloyd Dupont" <net.galador@ld> wrote in message news:...
    I have a Control like that
    ===
    public class BlogMonthList : Control, IPostBackEventHandler
    {
    protected override void Render(HtmlTextWriter writer)
    {
    writer.WriteLine(" <a href=\"{0}\">{1}</a><br/>",
    Page.ClientScript.GetPostBackClientHyperlink(this, "addblog"),
    strings.AddBlog);
    }
    public void RaisePostBackEvent(string eventArgument)
    {
    switch (eventArgument)
    {
    case "addblog":
    // do something
    break;
    }
    }
    }
    ===
    Now I have a breakpoint in RaisePostBack(), when I click the link, RaisePostBack is never called.
    How could that be?
    Is there some extra steps I have been missing?

    --
    I have taken a vow of poverty. If you want to really piss me off, send me money.
    Lloyd Dupont, Jan 11, 2006
    #3
  4. Lloyd Dupont

    Lloyd Dupont Guest

    Found it!
    My templated (C#) container control was not an INamingContainer itself!
    "Lloyd Dupont" <net.galador@ld> wrote in message news:...
    I have a Control like that
    ===
    public class BlogMonthList : Control, IPostBackEventHandler
    {
    protected override void Render(HtmlTextWriter writer)
    {
    writer.WriteLine(" <a href=\"{0}\">{1}</a><br/>",
    Page.ClientScript.GetPostBackClientHyperlink(this, "addblog"),
    strings.AddBlog);
    }
    public void RaisePostBackEvent(string eventArgument)
    {
    switch (eventArgument)
    {
    case "addblog":
    // do something
    break;
    }
    }
    }
    ===
    Now I have a breakpoint in RaisePostBack(), when I click the link, RaisePostBack is never called.
    How could that be?
    Is there some extra steps I have been missing?

    --
    I have taken a vow of poverty. If you want to really piss me off, send me money.
    Lloyd Dupont, Jan 11, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. valentin tihomirov

    another array ranges mystery

    valentin tihomirov, Jun 18, 2005, in forum: VHDL
    Replies:
    2
    Views:
    478
    Mike Treseler
    Jun 18, 2005
  2. John K. Humkey

    sed regexp mystery

    John K. Humkey, Jul 8, 2003, in forum: Perl
    Replies:
    0
    Views:
    2,043
    John K. Humkey
    Jul 8, 2003
  3. bjh

    Mystery Repost

    bjh, Jan 13, 2004, in forum: Perl
    Replies:
    0
    Views:
    721
  4. Todd Plambeck

    Mystery Error

    Todd Plambeck, Jul 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    502
    Victor Garcia Aprea [MVP]
    Jul 15, 2003
  5. Jim Hammond

    datagrid template column binding mystery

    Jim Hammond, Nov 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    545
    Jim Hammond
    Nov 24, 2003
Loading...

Share This Page