0
나는 부트 스트랩 v3.3 모달을 사용하고 jquery와 레이블에 값을 할당, 어떻게 C#에서 button_click과 함께 할당 lable의 값을 얻을 수 있습니까? 텍스트 상자에 값을 전달할 수 있지만 텍스트 상자에서 값을 가져올 수는 있지만 lable에서는 값을 가져올 수 없습니다. 아래 코드를 사용하고 있습니다.버튼 클릭 jquery에 의해 assinged의 가치를 얻을
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="exampleModalLabel" runat="server"></h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="recipient-name" id="lblOldValue" class="control-label" runat="server">Brand:</label>
<asp:TextBox ID="txtUpdate" runat="server" class="form-control"></asp:TextBox>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="btnUpdate" runat="server" class="btn btn-primary" Text="Save" OnClick="btnUpdate_Click"/>
</div>
</div>
</div>
</div>
$('#exampleModal').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget); // Button that triggered the modal
var recipient = button.data('whatever'); // Extract info from data-* attributes
var modal = $(this);
modal.find('.modal-title').text('Edit: ' + recipient);
modal.find('modal-body lable').val(recipient);
modal.find('.modal-body input').val(recipient);
});
protected void btnUpdate_Click(object sender, EventArgs e)
{
string newValue = txtUpdate.Text;
string oldValue = lblOldValue.InnerText;
}
그래서 당신은'간단한 구글 검색을 수행하기 위해 이미 검색 및 다른 솔루션을 시도 ... 1 초 미만에 다시 – MethodMan
을 히트 jquery' 톤의 라벨의 값을 와서 얼마나 알고 있지만, 나는 어떤 해결책을 찾지 못했습니다. –