__doPostBack in custom rendered page

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!
 
G

George Ter-Saakov

__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.
 
B

bruce barker \(sqlwork.com\)

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


-- bruce (sqlwork.com)
 
S

Smokey Grindle

awesome, thanks a lot!

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


-- bruce (sqlwork.com)
 

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