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. Image for the cookie policy date

Create Dialog in Server-Side

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???

3 Replies

SS Saranya Sivakumar Syncfusion Team 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



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

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


ES Ezhil S Syncfusion Team 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

Loader.
Up arrow icon