I have a detail and create page.
On my Detail Page i call my create page by using javascript and dispaly it to webdialog.
<script type="text/javascript">
function showDialog() {
var dialogcf = $find("<%=webDialogCreate.ClientID%>");
//Add code to handle your event here.
dialogcf.set_windowState($IG.DialogWindowState.Normal, true);
};
</script>
<ig:WebDialogWindow runat="server" ID="webDialogCreate" Modal="True" Moveable="False" WindowState="Hidden"
InitialLocation="Centered" StyleSetName="Office2007Blue" Height="560px" Width="800px">
<Header CaptionText="Create">
<CloseBox Visible=false />
</Header>
<ContentPane ContentUrl="CreatePage.aspx" ScrollBars="Hidden">
</ContentPane>
</ig:WebDialogWindow>
Now my problem is how to hide this WebDialog on my createdpage in code behind.
protected void lnkHide_Click(object sender, EventArgs e)
{
//Clear Session
Session["id"] = null;
//Hide webDialogCreate ???
}
I really need your help..
Thanks in regards!
Hi NewbApps,
Please let me know if you need further assistance with this matter.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Hiding the dialog as per your requirement is possible using client-side code. I have created a sample for you demonstrating such a scenario - the button on Default.aspx page shows the WebDialog with Create.aspx shown inside it.
Through the iframe element which contains the Create.aspx document we can access the controls inside it (.i.e. hideButton). Then by javascript we can subscibe an event handler from Default.aspx for the button in Create.aspx. This way the WebDialogWindow is accessible in the handler and may be hidden.
Here is the relevant javascript code:
function showWebDialog() { //show web dialog var dialogcf = $find("<%=webDialogCreate.ClientID%>"); dialogcf.set_windowState($IG.DialogWindowState.Normal, false); //subscribe a handler for the closing button in the Create.aspx page by accessing the iframe var iframe = ig_controls.webDialogCreate.get_element().children[2].children[0].children[0].children[0].children[1].children[0].children[0]; var closeButton = iframe.contentDocument.getElementById("ButtonHideWebDialog"); closeButton.onclick = function () { dialogcf.set_windowState($IG.DialogWindowState.Hidden, false); }; return false; }
Please let me know if this helps.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
Hi , It does not work....My webDialog is in the parent page and not on the create page so it got an error that create page cannot find webDialogCreate.ClientID.
Thanks in advance
Protected Sub btClose_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCloseForm.Click
If Not ClientScript.IsStartupScriptRegistered("closeDialogWindow") Then
Page.ClientScript.RegisterStartupScript(Me.GetType(), "closeDialogWindow", "closeDialogWindow();", True)
End If
End Sub
function closeDialogWindow() {
var dialogWindow = this.parent.$find("<%=webDialogCreate.ClientID%>");
dialogWindow.set_windowState($IG.DialogWindowState.Hidden, true);
Just adjust the above btClose_Click code to InkHide_Click...