There is a site with a table of contacts.
Everything is fine, I take data from the database, everything works.
Now the problem with the button "Find All". This is the modal window call button.
<td> <asp:Button ID="ShowContact" runat="server" Text="Узнать всё" data-toggle="modal" CssClass="btn btn-success btn-xs" CommandArgument = '<%# Eval("id") %>' data-target="#myModal" OnCommand="ShowContact_Click"/> </td> Here I pass the record id CommandArgument = '<%# Eval("id") %>' , which caused the modal window.
As I understand it, I need to click the OnCommand="ShowContact_Click" to send a request to the database and get data on the contact. How can I do this?
protected void ShowContact_Click(object sender, CommandEventArgs e) { int rowInd = Convert.ToInt32(e.CommandArgument); conn = new MySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["MySQLString"].ConnectionString); comm = new MySqlCommand("Команда", conn); } } Base type
persons +----+-----------+-----+ | id | firstname | age | +----+-----------+-----+ | 1 | Катя | 12 | | 2 | Лена | 18 | +----+-----------+-----+ email +----+-----------+-----------+ | id | email | person_id | +----+-----------+-----------+ | 1 | wer@sdf.ru| 1 | | 2 | | 2 | +----+-----------+-----------+ telephone +----+-----------+-----------+ | id | phone | person_id | +----+-----------+-----------+ | 1 | 3423434324| 1 | | 2 | | 2 | +----+-----------+-----------+ How can I transfer the full name of a person to the header of a modal window?
Modal window code:
<!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <asp:UpdatePanel ID="upModal" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"> <ContentTemplate> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title"> </h4> </div> <div class="modal-body"> <p>Some text in the modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </ContentTemplate> </asp:UpdatePanel> </div> </div> 
labelModalTitle = strUserFIO;Show the code of the modal window. - Ella Svetlaya