Click here to Skip to main content
13,192,426 members (49,241 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hello Mentors,

I am trying to call a code behind function of another page from javascript of my page using _dopostback.

But its not calling.

I tried calling the load event of that page also even that is not being fired.

my call is:

__doPostBack(window.parent.frames["firstGrid"].document.getElementById('InboxGrid').id, '');

please tell me where i am wrong?

can i use __dopostback to call the codebehind function of another page?
Posted 8-Jan-13 21:47pm
Updated 10-Jan-13 20:27pm
v2
Comments
Sandeep Mewara 9-Jan-13 4:04am
   
doPostback with TWO underscores, right?

__dopostback - right
_dopostback - wrong

Please confirm.
gouravkaila 9-Jan-13 6:05am
   
yes i am using it same way i.e. with two underscores but still not wrking.
Sandeep Mewara 9-Jan-13 8:03am
   
When and how it is called?
gouravkaila 9-Jan-13 8:19am
   
I am calling it on the client click of a button.
i have two pages one with a button and one wit a gridview.
on the click of that button i want to delete a particular row of the grid.I want to call the rowdeleting event of gridview from this page.
please suggest. Do i need to paste my code?
gouravkaila 10-Jan-13 1:45am
   
Can i call the code behind of another page from __dopostback ?

1 solution

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

Solution 1

Use XMLHTTPRequest Concept to delete the record in another page.

XMLHTTPRequest example[^]


After deleting the record, refresh the current page by using script as follows,before this save one temp variable in hidden variable as

document.getElementById('hdnDeletedRecord').value='DELETE';
document.forms[0].submit();

In aspx.cs page

check this variable and if hidden variable contains 'DELETE' then reload the grid.
  Permalink  
v2
Comments
gouravkaila 11-Jan-13 6:30am
   
Thanks a lot sanjeev.I have already tried that but the issue is that i am deleting the records from a grid that is present on another page.If i use xmlhttprequest,it deletes the records but i cant refresh the gridview to get the updated data without a postback or reloading.I am using removeat function for that .So i want to call the same using __dopostback.
Sanjeev Alamuri 11-Jan-13 6:39am
   
check my updated solution.
gouravkaila 11-Jan-13 7:46am
   
i could not find it sir

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 |
Web01 | 2.8.171017.2 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2017
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