I have a very strange issue which I just don't understand. I have an asp.net repeater control which is built into a jquery modal.
The code for the control is here.
<div id="dialog" style="display:none">
<asp:Repeater id="myrepeater" runat="server" >
<HeaderTemplate></HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="txtAnswer" TextMode="MultiLine" Columns="50" Rows="4" runat="server" />
</ItemTemplate>
<FooterTemplate></FooterTemplate>
</asp:Repeater>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" style = "display:none" OnClick="Submit1" OnClientClick="return ValidateInput()" />
I then call jquery/javascript PopupCenter from asp.net vb.net code behind method.
function PopupCenter() {
$(function () {
$("#dialog").dialog({
title: "Questions and answers",
width: 1200,
height: 750,
buttons: {
Ok: function () {
$("[id*=Button1]").click();
},
Close: function () {
$(this).dialog('close');
}
}
});
});
}
Everything works well. the modal appears with the textboxes. I have bound my asp.net button to a postback event called Submit1. Inside the code behind which successfully fires I then do this...
Protected Sub Submit1(ByVal sender As Object, ByVal e As System.EventArgs)
For i = 0 To myrepeater.Items.Count - 1
Dim dynTxtAnswer As TextBox = DirectCast(qtaRepeater.Items(i).FindControl("txtAnswer"), TextBox)
Next
End Sub
So in above for loop what I am expecting is the Text values for the textboxes in the repeater. I can get access to the textboxes. Just it states an empty string and not the string values. So overall completely stumped. I wondered if anyone had an idea of why this is happening.
Thank you.