__doPostBack in custom rendered page

  • Thread starter Thread starter Smokey Grindel
  • Start date Start date
S

Smokey Grindel

I have a page with no ASP.NET controls on it put I have links that use the
__doPostBack('','') javascript method on it, it wont work, oh course I know
why, the script isnt registered.. because if you add a asp.net control to
the page suddently it works! remove it, it gives an error on clicking... how
do you get the scripts needed for it to register without having to place a
control on the form? thanks!
 
__doPostBack is added automaticly by .NET my guess HtmlForm object creates
it once it decides it need it.

Not sure how to make it appear programmatically but I have a workaround.
Just drop LinkButton on your form and specify empty text for it. Thus link
will not be visible but __doPostBack will be created on the Form

George.
 
calling ClientScript.GetPostBackEventReference() will cause the proper
client code to be genereated.


-- bruce (sqlwork.com)
 
awesome, thanks a lot!

bruce barker (sqlwork.com) said:
calling ClientScript.GetPostBackEventReference() will cause the proper
client code to be genereated.


-- bruce (sqlwork.com)
 
Back
Top