title: Populate bootstrapdialog text from codebehind
body: <p>Having trouble setting the text for my pop-up in codebehind, it will refresh the page, meaning the pop-up disappears. </p>
  
  <p>I tried following an example/tutorial but can't seem to get it to work. I've tried moving the update panel around, and using autopostback = false on the button. I'm sure it's something silly but i just can't see it..</p>
  
  <p>Here is my aspx page;</p>
  
  <pre><code>&lt;%@ Page Language="vb" AutoEventWireup="false" 
  CodeBehind="ShowDialog.aspx.vb" Inherits="BootStrapDialog.WebForm1" 
  MaintainScrollPositionOnPostBack="true" %&gt;
  
  &lt;!DOCTYPE html&gt; 
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;title&gt;Bootstrap 101 Template&lt;/title&gt;
  &lt;!-- Bootstrap --&gt;
  &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
      rel="stylesheet"&gt;
  &lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;
  &lt;!-- WARNING: Respond.js doesn't work if you view the page via file:// --&gt;
  &lt;!--[if lt IE 9]&gt;
    &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;h1&gt;
              Hello, world! Hello, world!&lt;/h1&gt;
          &lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;!-- Include all compiled plugins (below), or include individual files as needed --&gt;
          &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
          &lt;asp:Button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" Text="Launch demo modal" OnClick="GenerateModalText" runat="server"&gt;
  
          &lt;/asp:Button&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
              &lt;ContentTemplate&gt;
                  &lt;!-- Modal --&gt;
                  &lt;asp:Label ID="Label1" runat="server" Text=""&gt;&lt;/asp:Label&gt;&lt;br /&gt;
                  &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                      aria-hidden="true"&gt;
                      &lt;div class="modal-dialog"&gt;
                          &lt;div class="modal-content"&gt;
                              &lt;div class="modal-header"&gt;
                                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                                      &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
                                  &lt;h4 class="modal-title" id="myModalLabel"&gt;
                                      Modal title&lt;/h4&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-body"&gt;
                                  &lt;asp:TextBox ID="TextBox1" runat="server" class="form-control"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-footer"&gt;
                                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;
                                      Close&lt;/button&gt;
                                  &lt;%--&lt;button type="button"  class="btn btn-primary"&gt;
                                      Save changes&lt;/button&gt;--%&gt;
                                  &lt;asp:Button Text="Save" OnClick="Submit" runat="server" /&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>And this is my codebehind VB.NET;</p>
  
  <pre><code>Public Class WebForm1
  Inherits System.Web.UI.Page
  
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  End Sub
  
  Protected Sub Submit()
  
  End Sub
  
  Protected Sub GenerateModalText()
      Dim txt As String = "This is sample text genereated from codebehind"
      TextBox1.Text = txt
  End Sub
  
  
  
  End Class
  </code></pre>
  
  <p>Any help would be appreciated</p>