Click here to Skip to main content
13,352,879 members (68,377 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Mentors,

Could anybody tell me how can i use __dopostback method to call the codebehind of another page.

I want to override the __dopostback so that i could change the value of theform and set it equal to the form for which i want to call the _postback.

this is what does automatically---

var theForm = document.forms['Form1'];
if (!theForm) {
    theForm = document.Form1;
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;

i want to set the theForm =window.parent.self.firstGrid.document.Form1;

as i want to call the code behind of Form1 which is another aspx.
Posted 11-Jan-13 1:34am
Updated 11-Jan-13 1:37am
ryanb31 11-Jan-13 7:57am
This sounds like a bad idea. Maybe you can explain why you want to do this and we can figure out a more proper way to do what you need.
gouravkaila 14-Jan-13 4:20am
The issue is that..i have 2 pages.One is header page and another aspx page which i am using to load the Gridview.
I want to delete the GridView rows on click of a button placed on Header page.

Now the issue is that i am using Datatable.rows.removeat(Index) to remove a row from the gridview without a postback.

As both the pages are different so on click of a button on header page is not refreshing the Grid on another page.For that i am calling

__doPostBack('InboxGrid', 'Delete$0')

from the Header page. Kindly suggest the alternate if any.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Thanks All,

Its working fine now.

default__doPostBack = __doPostBack;

   var theForm = window.parent.self.firstGrid.document.Form1;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100