Hi i use the window.open() javascript function, then i want to use the __doPostback('','') javascript function to force the page post back , so that i can use the parameter pass from the child window in the page.ispostback event. but i try to use __doPostback('','')
in my 1.1 .net framework, nothing happen????? how to use the __doPostback('','') or how to let the page have .postback event?
You need to use the server-side function: Page.GetPostBackEventReference and tell it what control's event you want to fire. The __doPostBack('','') won't fire any client-side events because the first parameter, which is the client name of the control raising
the event, isn't set.
hi stiletto, i'm new for asp.net can you please tell me the sample of using server-side function: Page.GetPOstBackEventReference ???? or which place i can refer to this? for the __doPostBack('','') , how can i use to put the first parameter ?????
I'll need more specifics on page flow before I can be definitive, but here's the MSDN link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuipageclassgetpostbackeventreferencetopic.asp
Hi stiletto, now i describe my page more detail, 1.in the parent window, i use a button to call javascript function: <script language="javascript"> function GetDate(CtrlName) { ChildWindow=window.open('color.aspx?FormName='+ document.forms[0].name+ '&CtrlName='+
CtrlName, "Color","width=500,height=400,top=100,left=200,toobars=no,scrollbars=no,status=no,resizable=no"); __doPostback(CtrlName,''); } to show a child window which contain a list of color. 2.a child window pop up. 3.after i choose one of the color from the
childwindow and i click a button (to call javacript: <script language="javascript"> function ReturnColor(){ window.close(); window.opener.document.forms[""].elements[""].value = ""; __doPostback("",''); } </script> 4.the child window closed and get a value(strselectedcolor)
from childwindow and put into variable "Ctrl" which is textbox id. AND textbox.text = "strselectedcolor". All of this is ok if i just the textbox.text. But i want to change textbox.backcolor, not textbox.text! thanks!
Is this a cross-browser application? If it's IE-only then you should be able to (from your child window): window.opener.document.all["].style.backgroundColor = ""; to change the textbox's background color.
That's OK the style can be a color name, just change: window.opener.document.all["].style.backgroundColor = ""; to: window.opener.document.all["].style.backgroundColor = '""';
psjie
Participant
920 Points
184 Posts
HOw to use __doPostback('','')?????????
Mar 26, 2004 12:34 AM|LINK
stiletto
All-Star
16995 Points
3304 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 01:17 AM|LINK
psjie
Participant
920 Points
184 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 01:48 AM|LINK
stiletto
All-Star
16995 Points
3304 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 02:53 AM|LINK
psjie
Participant
920 Points
184 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 03:35 AM|LINK
stiletto
All-Star
16995 Points
3304 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 03:57 AM|LINK
psjie
Participant
920 Points
184 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 04:59 AM|LINK
stiletto
All-Star
16995 Points
3304 Posts
Re: HOw to use __doPostback('','')?????????
Mar 26, 2004 07:28 PM|LINK