We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Create Dialog in Servber-Side by C#

Thread ID:

Created:

Updated:

Platform:

Replies:

126008 Sep 17,2016 08:25 AM UTC Sep 19,2016 09:33 AM UTC ASP.NET Web Forms 1
loading
Tags: Dialog
kyousuke
Asked On September 17, 2016 08:25 AM UTC

Hi!
I want to create a Dialog control from server-side that is created automatically when a button is clicked.
I referred to "https://www.syncfusion.com/forums/120903/create-dialog-in-server-side" and converted the sample program(in VB)  to a program in C#, but it didn't work.

Below is my source code.
Please tell me what is wrong.
Thank you!

kyousuke


aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="satei_platform.test" %>

<%@ Register Assembly="Syncfusion.EJ.Web, Version=14.1451.0.41, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" Namespace="Syncfusion.JavaScript.Web" TagPrefix="ej" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <form runat="server">
     <div id="divtest" runat="server"></div> 

        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />


    </form>
</body>

</html>


cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace satei_platform
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Syncfusion.JavaScript.Web.Dialog test = new Syncfusion.JavaScript.Web.Dialog();

            test.ShowOnInit = true;
            test.IsResponsive = true;
            test.Title = "Preua";
            divtest.Controls.Add(test);
        }
    }
}

Selvamani Sankarappan [Syncfusion]
Replied On September 19, 2016 09:33 AM UTC

Hi Kyousuke,  
   
Thanks for contacting Syncfusion support,   
  
We had checked your code example. We suspect that an issue (Dialog is not opened when we click the button) with your code example may cause due to the JQuery which is not referred in your application. It throws the console error. We need ASP ScriptManager to render the dialog control since our scripts from assembly will be registered in it.   
We had prepared a sample based on your code example. Please refer to the following sample:   
   
If you still face any difficulties, kindly revert with error details and corresponding replication procedure.   
   
Regards,   
Selvamani S   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;