473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

__doPostBack in custom rendered page

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!
Nov 10 '06 #1
3 1683
__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.
"Smokey Grindel" <no****@nospam.netwrote in message
news:e0**************@TK2MSFTNGP04.phx.gbl...
>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!

Nov 10 '06 #2
calling ClientScript.GetPostBackEventReference() will cause the proper
client code to be genereated.
-- bruce (sqlwork.com)
"Smokey Grindel" <no****@nospam.netwrote in message
news:e0**************@TK2MSFTNGP04.phx.gbl...
>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!

Nov 10 '06 #3
awesome, thanks a lot!

"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote
in message news:%2******************@TK2MSFTNGP03.phx.gbl...
calling ClientScript.GetPostBackEventReference() will cause the proper
client code to be genereated.
-- bruce (sqlwork.com)
"Smokey Grindel" <no****@nospam.netwrote in message
news:e0**************@TK2MSFTNGP04.phx.gbl...
>>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!


Nov 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Randy | last post by:
Does anyone know of a situation where the "__doPostBack" function would not be auto-generated for your ASPX page? (ie. when the ASPX page is rendered in IE and you do a View Source, the...
3
by: Nikhil Patel | last post by:
Hi all, I have developed a web page with a sortable DataGrid with Select button column in ASP.Net. It works fine in inernet explorer. The purpose of the web page is to display it in a third party...
0
by: Granger Godbold | last post by:
This is in regards to the long-standing bug with the colons in the form-id. I'm not satisfied with the main workaround that's been circulating: http://www.asp.net/Forums/ShowPost.aspx?PostID=191953...
2
by: Henri | last post by:
I'm designing a custom control and I would like to use the __DOPOSTBACK JavaScript function. Is there a way to make this function appear other than inserting a dummy linkbutton inside my custom...
3
by: Marcelo | last post by:
Hello, I am trying to create a postback event, and it is working, just not calling the sub. I have a datagrid which has <asp:DataGrid id="Mensajes" ... <Columns> <asp:HyperLinkColumn ....
3
by: Steve Wonderful | last post by:
I checked the rendered html and found __doPostBack() function was not found in the html source. Is there a reason? How do I force it to be generated. The page seems to function properly for post...
6
by: GaryDean | last post by:
below is the html of two dropdownlists as they are rendered. The first was created with Postback = false and I added the onchange="myFunction('DropDownList1,'') in code. I made this look very...
1
by: Philip | last post by:
I am attempting to use the ASP.NET generated __doPostBack JavaScript function in my custom JavaScript and I can use it successfully but only after the web page is loaded and idle. I prefer to...
4
by: Waldy | last post by:
Hi there, I have a customer requirement to provide a web application without JavaScript. A function is being written to the HTML output on some pages. The function is called __doPostBack. How...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.