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 Server-Side

Thread ID:

Created:

Updated:

Platform:

Replies:

120903 Oct 26,2015 06:58 PM UTC Feb 17,2016 09:14 AM UTC ASP.NET Web Forms 3
loading
Tags: Dialog
Oscar Daniel Vega Castaneda
Asked On October 26, 2015 06:58 PM UTC

Hi

How can I create a Dialog control from the server-side. I saw this post (http://www.syncfusion.com/forums/119276/create-dialog-in-server-side) but Works for MVC, And I need for ASP.NET.

I've this code
Public Sub ShowDialog(texto As String)
       Dim Properties As New Models.DialogProperties() With {.Title = "Prueba",
           .Content = texto,
           .EnableModal = True,
           .IsResponsive = True,
           .ShowOnInit = True,
           .CloseOnEscape = True
           }
 
       Dim DialogToShow As New Dialog("dr" & DateTime.Now.Ticks.ToString, Properties)
 
       DialogToShow.Render()
 
End Sub
ksk
But I have this error

[NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.]
   Syncfusion.JavaScript.HtmlTag.Render(TextWriter writer) +73
   Syncfusion.JavaScript.Dialog.RenderControl(String controlId) +26
   Syncfusion.JavaScript.Dialog.CreateUnObtrusiveContainer(String controlId) +10
   Syncfusion.JavaScript.Control.Render() +58
   VivirOnline.Utilitarios.ShowDialog(String texto) in C:\Users\ovega\Source\Workspaces\VivirOnline\VivirOnline\App_Code\Utilitarios.vb:399
   VivirOnline.Login.Button1_Click(Object sender, EventArgs e) in C:\Users\ovega\Source\Workspaces\VivirOnline\VivirOnline\Account\Login.aspx.vb:83
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9659822
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.<ProcessRequestMainAsync>d__1.MoveNext() +5911

Was I'm wrong???

Saranya Sivakumar [Syncfusion]
Replied On October 27, 2015 09:55 AM UTC

Hi Oscar,

Thanks for contacting Syncfusion Support.

The reported issue will occur if the object returns null value as the result. We have to create and set the required properties to the Dialog control and then add it to the page / corresponding element as highlighted in the following code snippet.

<code>

Protected Sub ShowDialog(Sender As Object, e As Syncfusion.JavaScript.Web.ButtonEventArgs)

        Dim dial As New Syncfusion.JavaScript.Web.Dialog()

        dial.ShowOnInit = True

        dial.IsResponsive = True

        dial.Title = "Preua"

        contentdiv.Controls.Add(dial)

    End Sub

</code>

For your convenience we have prepared a sample to create Dialog in server side and the same can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/forum/120903/ze/ASPDialogVBServer-174482161

Kindly check with the above sample. If still you face the problem then please revert us by modifying the sample along with the replication procedure in which we can able to reproduce the issue in our end.

Regards,

Saranya.S


Oscar Daniel Vega Castaneda
Replied On February 16, 2016 04:04 PM UTC

Thank you!! That's work for me!!

Ezhil S [Syncfusion]
Replied On February 17, 2016 09:14 AM UTC

Hi Oscar,

Thanks for the update.

We are glad that the issue have been resolved at your end.

Please let us know if you need further assistance.

Regards,
Ezhil 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

;