TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anurag rawat
NA
56
922
In Datalist button inside Modalpopupextender not firing
Apr 20 2019 3:01 AM
I have a datalist under which there is a button to open Modalpopupextender. There is a Submit button in this modalpopupextender which is not firing. Please advice.
<body style="background-color: #F7F9F4; max-width: 100%; overflow-y: auto;">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<uc:Header ID="ucHeader" runat="server" />
<div>
<table style="width: 100%">
<tr>
<td colspan="2">
<asp:DataList ID="dl1" runat="server" CellPadding="20" RepeatDirection="Vertical"
Style="width: 100%;" OnItemCommand="dl1_ItemCommand"
onselectedindexchanged="dl1_SelectedIndexChanged" >
<ItemTemplate>
<table style="background-color: White; padding: 10px; border-color: Gray; width: 100%;">
<tr>
<td style="width: 30%; text-align: center;">
<asp:Image ID="imgPhoto" runat="server" ImageUrl='
<%# "~/CoachPhoto/" + Eval("CoachId") + ".jpg" %>' Style="margin-right: 20px; margin-left: 50px;"
Height="150px" Width="150px" BorderColor="Black" BorderStyle="Solid" />
</td>
<td style="width: 40%;">
<table style="width: 100%;">
<tr>
<td>
<asp:Label ID="lblName" runat="server" Font-Size="Large" ForeColor="DarkBlue" Text='<%# String.Format("{0} {1} {2} {3}", Eval("FirstName"), Eval("LastName"), ", ", Eval("AcademyName")) %>'>
</asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblLocation" Font-Size="Large" ForeColor="DarkBlue" runat="server"
Text='<%# Eval("Location") + ", " + Eval("City") %>'>
</asp:Label>
</td>
</tr>
<%--<tr>
<td>
<asp:Label ID="lblReview" ForeColor="Black" runat="server" Text="Review">
</asp:Label>
</td>
</tr>--%>
<tr>
<td>
<table style="width: 100%;">
<tr>
<td style="width: 50%;">
<div style="font-size: small;">
Sport
</div>
</td>
<td>
<div style="font-size: small;">
Starting at</div>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblSport" runat="server" Font-Size="Medium" ForeColor="Black" Text='<%# Eval("Sport") %>'>
</asp:Label>
</td>
<td>
<asp:Label ID="lblFees" runat="server" Font-Size="Medium" ForeColor="Black" Text='<%# String.Format("{0} {1} {2} {3}", "Rs", Eval("Fees"), "per", Eval("FeesType")) %>'>
</asp:Label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%;">
<tr>
<td style="width: 50%;">
<div style="font-size: small;">
Contact Number
</div>
</td>
<td>
<div style="font-size: small;">
Location</div>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="hypTelephoneNumber" runat="server" NavigateUrl='<%# "tel:" + Eval("Mobile")%>'
Font-Size="Medium" ForeColor="Black" Text='<%# Eval("Mobile") %>' />
</td>
<td>
<asp:Label ID="lblCompleteLocation" runat="server" Font-Size="Medium" ForeColor="Black"
Text='<%# Eval("Address") + ", " + Eval("Location") %>'>
</asp:Label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblProfile" Font-Size="Medium" ForeColor="Black" runat="server" Text='<%# Eval("CoachProfile") %>'>
</asp:Label>
</td>
</tr>
</table>
</td>
<td>
<%--<asp:Button ID="lnkViewProfile" runat="server" Text="View Profile" PostBackUrl='<%# String.Format("{0} {1}", "~/CoachProfile.aspx?Id=", Eval("CoachId")) %>'>
</asp:Button><br />
<br />--%>
<asp:Button ID="btnMessageCoach" runat="server" Text="Message Coach" Style="border-radius: 5px;
height: 30px; background: #32BC29; width: 180px; color: Black;">
</asp:Button>
<cc1:ModalPopupExtender ID="mdMessage" BehaviorID="behaviorIDmp3" runat="server"
PopupControlID="Panel3" TargetControlID="btnMessageCoach" CancelControlID="lnkCancelMessage"
DropShadow="true" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel3" runat="server" CssClass="modalPopup" align="center" Style="display: none;
height: 450px; width: 650px;" DefaultButton="btnSendMessage">
<asp:TextBox ID="txtMessage" TextMode="MultiLine" Height="200px" runat="server" class="txtFirstName"
Width="500px" name="email" Font-Size="Large" Style="margin-bottom: 30px; margin-top: 20px;" ValidationGroup="Message"
PlaceHolder="Message" /><br />
<asp:RequiredFieldValidator EnableClientScript="true" ID="reqtxtMessage" runat="server"
ValidationGroup="Message" ForeColor="Red" ControlToValidate="txtMessage" ErrorMessage="Message Empty"
Display="Dynamic" /><br />
<asp:TextBox ID="txtContactNumber" runat="server" class="txtFirstName" Width="500px"
name="contactnumber" value="" Height="40px" Font-Size="Medium" PlaceHolder="Contact Number" />
<asp:RequiredFieldValidator EnableClientScript="true" ID="reqtxtContactNumber" runat="server"
ValidationGroup="Message" ForeColor="Red" ControlToValidate="txtContactNumber"
ErrorMessage="Contact Number Empty" Display="Dynamic" /><br />
<asp:RegularExpressionValidator ID="regtxtContactNumber" runat="server" ControlToValidate="txtContactNumber"
ValidationGroup="Message" ErrorMessage="RegularExpressionValidator" ForeColor="Red"
ValidationExpression="[0-9]{10}" Text="Enter 10 digit mobile number"></asp:RegularExpressionValidator>
<div>
<asp:Button ID="btnSendMessage" ValidationGroup="Message" runat="server" Text="Send"
Style="border-radius: 5px; height: 35px; background: #32BC29; width: 400px;
color: Black; margin-top: 30px; color: Black;"/></div>
<br />
<asp:HyperLink ID="lnkCancelMessage" runat="server" Text="Cancel" CssClass="btnClosePopup"
Style="margin-top: 10px;">Close</asp:HyperLink>
</asp:Panel>
<br />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</div>
<div style="position: fixed; right: 0; bottom: 0;">
<uc:Message ID="ucMessage" runat="server" />
</div>
</form>
</body>
Reply
Answers (
1
)
Regarding getting default values.
How to limit the number of words in datalist?