mystery!

L

Lloyd Dupont

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?
 
L

Lloyd Dupont

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....
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?
 
L

Lloyd Dupont

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...
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?
 
L

Lloyd Dupont

Found it!
My templated (C#) container control was not an INamingContainer itself!
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?
 

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top