Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > mystery!

Reply
Thread Tools

mystery!

 
 
Lloyd Dupont
Guest
Posts: n/a
 
      01-11-2006
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 **** me off, send me money.

 
Reply With Quote
 
 
 
 
Lloyd Dupont
Guest
Posts: n/a
 
      01-11-2006
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:(E-Mail Removed)...
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 **** me off, send me money.

 
Reply With Quote
 
 
 
 
Lloyd Dupont
Guest
Posts: n/a
 
      01-11-2006
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:(E-Mail Removed)...
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 **** me off, send me money.

 
Reply With Quote
 
Lloyd Dupont
Guest
Posts: n/a
 
      01-11-2006
Found it!
My templated (C#) container control was not an INamingContainer itself!
"Lloyd Dupont" <net.galador@ld> wrote in message news:(E-Mail Removed)...
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 **** me off, send me money.

 
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




Advertisments