Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

__doPostBack

Status
Not open for further replies.

SpeedBWild

Programmer
Apr 29, 2004
117
US
On click of a button a open a new window with tue code below.
Me.PageBody.Attributes.Remove("onload")
Session("FileName") = fileName
Me.PageBody.Attributes.Add("onload", "jsLoadWindow();")

Here is the jsLoadWindow function as well.

function jsLoadWindow() {
var retval="";
var features= "dialogWidth=650px,scrollbars=yes,toolbars=no,status=yes,Height=200px,top=0";
retval=window.showModalDialo('ManageJobDetail.aspx',retval, features);
alert(retval);
window.execScript("__doPostBack('ManageJobDetail','" + retval +"')","JavaScript");
}

The code is erroring on the window.execScript() in the jsLoadWindow function. When I look at the source code I don't see the function __doPostBack() How does that get there. Am I missing something else on my page? I know the _doPostBack get generated automatically, but I don't know what causes it to be generated.

I have an alert in my jsLoadWindow function so I know I am getting the correct return value for the child page. If I comment out the window.execScript I don't get any error, but as you can guess my pgae doesn't do what I need it to.

Any ideas?

Thanks,
 
Why are you trying to open a new window and then force it to postback to itself?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
If I don't force the postback how do I get the page to reload? What I am doing it opening up a page then once they are done and have closed this page either with the cancel button the process button or by the 'X', I want to capture that. Then when the page reloads I can direct it to the appropriate vb.net function. If there is a better or easier way to do this. I'm open to suggestions.
 
Oh, so you are trying to show a modal dialog window that will return a value to a parent page? I see...

The most likely reason that the "__doPostBack" event doesn't appear in your pop-up page is to do with the controls that are on that page. The javascript event only gets included in the page if it is needed. Try adding a LinkButton onto the page (it doesn't have to do anything for now) just to see if you have access to the function.




____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Would an <asp:button work? Does it have to be a <asp:linkButton? I thought any item that caused an onclick event would work. Am I mistaken?
 
Sorry, I hit submit to early. I will try and add a linkbutton to see it that matters.
 
Okay, so using a linkbutton worked. I bet using an imagebutton does the same thing, huh?
 
Actually, no it won't...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top