Home All Groups Group Topic Archive Search About

problem creating a custom control

Author
31 Dec 2005 10:52 AM
Lloyd Dupont
I'm creating an 'owner drawn ASP.NET control' where all the HTML tags are
written in the Render() method.
In this control there would be 2 links: Edit & Comment.
I would like to use a <A HREF='...'>
But in the HREF tag I would like to write the special URL which will call:
RaisePostBackEvent(string eventArgument)

with an 'eventArgument' of my choosing.
However I have no idea what that should be!

Looking at what's generated by LinkButtton I guess it's something like:
"javascript:__doPostBack('{UniqueId}','myArgument')"

But I wonder if there was a framework method to create this URL instead of
hard coding it directly myself...

Author
31 Dec 2005 10:59 AM
Lloyd Dupont
found it!
Page.GetPostBackClientHyperlink(this, "edit")


Show quote
"Lloyd Dupont" <net.galador@ld> wrote in message
news:uWbGKhfDGHA.2704@TK2MSFTNGP11.phx.gbl...
> I'm creating an 'owner drawn ASP.NET control' where all the HTML tags are
> written in the Render() method.
> In this control there would be 2 links: Edit & Comment.
> I would like to use a <A HREF='...'>
> But in the HREF tag I would like to write the special URL which will call:
> RaisePostBackEvent(string eventArgument)
>
> with an 'eventArgument' of my choosing.
> However I have no idea what that should be!
>
> Looking at what's generated by LinkButtton I guess it's something like:
> "javascript:__doPostBack('{UniqueId}','myArgument')"
>
> But I wonder if there was a framework method to create this URL instead of
> hard coding it directly myself...
>

AddThis Social Bookmark Button