WebDialog

Dear All,
I have successfully call an asp.net webdialog using javascript.
<script language="javascript" type="text/javascript">
function OpenChild()
{
var vKodeCustomer = document.getElementById("tbKodeCustomer").value;
var vNamaCustomer = document.getElementById("tbCustomerName").value;
var vWilayah = document.getElementById("tbWilayah").value;
var vShipVia = document.getElementById("tbShipVia").value;
var vKodeDC = document.getElementById("ddlKodeDC").value;
var ChildArgs = new Array();
ChildArgs[0] = vKodeCustomer;
ChildArgs[1] = vNamaCustomer;
ChildArgs[2] = vWilayah;
ChildArgs[3] = vShipVia;
ChildArgs[4] = vKodeDC;
var WinSettings =
"center:yes;resizable:no;dialogHeight:600px;dialogWidth=800p x"
//ALTER BELOW LINE - supply correct URL for Child Form
var ResultArgs =
window.showModalDialog("http://localhost:2830/Lighthouse/Set up/custrutekapal.aspx",
ChildArgs, WinSettings);
if (ResultArgs == null)
{
//window.alert("Nothing returned from child. No changes made to
input boxes");
}
else
{
//retvalA.value=MyArgs[0].toString();
}
}
</script>

But postback for example click on button on webdialog (child) always create
new non dialog page.
How to fixed it?

TIA,
Gun
gunawan [ Mi, 09 April 2008 10:08 ] [ ID #1938591 ]

Re: WebDialog

Place

<base target="_self">

in the <head> section of the dialog.


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Gunawan" <jgun98.milis [at] gmail.com> wrote in message
news:epbQ1jhmIHA.4684 [at] TK2MSFTNGP06.phx.gbl...
> Dear All,
> I have successfully call an asp.net webdialog using javascript.
> <script language="javascript" type="text/javascript">
> function OpenChild()
> {
> var vKodeCustomer =
> document.getElementById("tbKodeCustomer").value;
> var vNamaCustomer =
> document.getElementById("tbCustomerName").value;
> var vWilayah = document.getElementById("tbWilayah").value;
> var vShipVia = document.getElementById("tbShipVia").value;
> var vKodeDC = document.getElementById("ddlKodeDC").value;
> var ChildArgs = new Array();
> ChildArgs[0] = vKodeCustomer;
> ChildArgs[1] = vNamaCustomer;
> ChildArgs[2] = vWilayah;
> ChildArgs[3] = vShipVia;
> ChildArgs[4] = vKodeDC;
> var WinSettings =
> "center:yes;resizable:no;dialogHeight:600px;dialogWidth=800p x"
> //ALTER BELOW LINE - supply correct URL for Child Form
> var ResultArgs =
> window.showModalDialog("http://localhost:2830/Lighthouse/Set up/custrutekapal.aspx",
> ChildArgs, WinSettings);
> if (ResultArgs == null)
> {
> //window.alert("Nothing returned from child. No changes made to
> input boxes");
> }
> else
> {
> //retvalA.value=MyArgs[0].toString();
> }
> }
> </script>
>
> But postback for example click on button on webdialog (child) always
> create new non dialog page.
> How to fixed it?
>
> TIA,
> Gun
>
Eliyahu Goldin [ Mi, 09 April 2008 10:46 ] [ ID #1938596 ]

Re: WebDialog

"Gunawan" <jgun98.milis [at] gmail.com> wrote in message
news:epbQ1jhmIHA.4684 [at] TK2MSFTNGP06.phx.gbl...

> How to fix it?

<head>
<base target="_self">
</head>

Also, bear in mind that showModalDialig can not be used on a public site
because it works only in Microsoft IE and Apple Safari...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net
mark [ Mi, 09 April 2008 11:21 ] [ ID #1938598 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » WebDialog

Vorheriges Thema: Visual Studio 2003 blowing chunks
Nächstes Thema: Connection to web server lost uploading files of 100mb