productreviewcontrol.ascx
来自「C#语言制作asp.net网上商店的」· ASCX 代码 · 共 198 行
ASCX
198 行
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ProductReviewControl.ascx.vb" Inherits="Shop_Product_Controls_ProductReviewControl" %>
<%@ Register Assembly="Xpdt.Web.UI.Ratings" Namespace="Xpdt.Web.UI.WebControls" TagPrefix="Xpdt" %>
<div style="margin-left:15px;">
<asp:MultiView ID="mvReview" runat="server" ActiveViewIndex="0">
<asp:View ID="vReview" runat="server" >
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td colspan="2"><br /><b>
告诉我们你的想法:</b><br />
<br />
谢谢你拿出时间来交流意见.请填写下面的详细评论信息.</td>
</tr>
<tr valign=top>
<td >
<strong> <asp:Label ID="lbProductName" runat="server" skinid=bigred ></asp:Label></strong></td>
<td align=left>
</td>
</tr>
<tr style="font-weight: bold">
<td colspan="2">评论者:</td>
</tr>
<tr style="font-weight: bold">
<td ><asp:TextBox ID="txtReviewer" runat="server" Width="420px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="请输入评论这姓名" ControlToValidate="txtReviewer" validationgroup="review" SetFocusOnError="True">*</asp:RequiredFieldValidator></td>
<td valign="top" >
</td>
</tr>
<tr>
<td colspan="2" align="left"><table border="0" cellpadding="0" cellspacing="2" width="100%">
<tr>
<td colspan="2" align="left" valign=middle class="Pager" style="height: 18px"><strong> 为该商品评级 </strong> </td>
</tr>
<tr >
<td colspan="2" align="left" valign="top"><xpdt:rater id="Rater1" runat="server" DisplayValue="5" EnableTheming="True"></xpdt:rater><strong>
<br />
</strong> </td>
</tr>
<tr >
<td colspan="2" align="left" valign="top"> 非常好(5星) 比较好(4星) 一般(3星) 不怎么好(2星) 太差了(1星)<br /></td>
</tr>
<tr >
<td colspan="2" align="left" valign="top"><span style="height: 18px"><strong>推荐给你的朋友 </strong></span></td>
</tr>
<tr >
<td colspan="2" align="left" valign="top"> <asp:RadioButtonList ID="rbComment" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
<asp:ListItem Value="-1">是</asp:ListItem>
<asp:ListItem Value="0">否</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="rbComment"
ErrorMessage="请选择是否推荐给朋友" ValidationGroup="review" SetFocusOnError="True">*</asp:RequiredFieldValidator>
<br />
</td>
</tr>
<tr style="color: #000000">
<td colspan="2" align="left" valign=middle height=18px class="Pager"><b>请输入您的评论</b></td>
</tr>
<tr>
<td align="left" valign="top" style="width: 346px">
<strong>评论标题:</strong>
</td>
<td width="75%" align="left" valign="top" ><strong> </strong></td>
</tr>
<tr style="font-weight: bold">
<td align="left" valign="top" style="width: 346px"><asp:TextBox ID="txtTitle" runat="server" Width="420px"></asp:TextBox> </td>
<td align="left" valign="top"><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入评论标题" ControlToValidate="txtTitle" validationgroup="review" SetFocusOnError="True">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td align="left" valign="top" style="width: 346px" ><strong>评论内容:</strong></td>
<td align="left" valign="top" > </td>
</tr>
<tr>
<td align="left" valign="top" style="width: 346px" ><asp:TextBox ID="txtComments" runat="server" Height="126px" TextMode="MultiLine" Width="420px"></asp:TextBox> </td>
<td align="left" valign="top" ><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtComments"
ErrorMessage="请输入评论内容" validationgroup="review" SetFocusOnError="True">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top" >
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtComments"
ErrorMessage="你的评论最少也要50个字。" ValidationExpression="^(.|\n){0,100}$" ValidationGroup="review"
Width="15px">*</asp:RegularExpressionValidator>你的评论最少也要50个字。</td>
</tr>
<tr>
<td colspan="2" align="left" valign=middle height=18px class="Pager"><strong>请输入您的信息</strong></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top" >位置(例如:江苏徐州)<br />
<asp:TextBox ID="txtLocation" runat="server" Width="420px"></asp:TextBox></td>
</tr>
</table>
<asp:Button ID="btnReview" runat="server" Text="预览" validationgroup="review" Width="95px" />
<asp:Button ID="Button1" runat="server" Text="取消" Width="95px" /></td>
</tr>
</table>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
ShowSummary="False" ValidationGroup="review" />
</asp:View>
<asp:View ID="vPreview" runat="server">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td><strong>
<br />
请核对你的评论内容,点击“提交”按钮发送。</strong> 如果在你写的评论内容中有错误或者希望取消评论内容,请点击编辑或者取消按钮来操作。<p>
注意:你的评论内容将在提交后的72小时之内被审核。感谢你的参与评论。.</p></td>
</tr>
<tr>
<td style="height: 110px">
<br /> <div id ="Pannel">
<table width="600" class="ProductBox">
<tr>
<td colspan="2">
<Xpdt:Rater ID="rvRating" runat="server" DisplayOnly="True"></Xpdt:Rater>
<b>
<%=txtTitle.Text%>
</b>,
<%=String.Format("{0:f}", Now)%>
</td>
</tr>
<tr>
<td colspan="2">
<b>评论者:
<%=txtReviewer.Text%>
<%=IIf(txtLocation.Text.Length = 0, "", String.Format("({0})", txtLocation.Text))%>
</b>
</td>
</tr>
<tr>
<td colspan="3" style="width: 597px">
<%=txtComments.Text%>
</td>
</tr>
<tr>
<td colspan="3" style="width: 597px; height: 40px">
<br /><b>是否推荐给你的朋友:</b><%=IIf(CInt(rbComment.SelectedValue) = 0, "否", "是")%></td>
</tr>
</table></div>
</td>
</tr>
<tr>
<td style="height: 42px">
<br />
<asp:Button ID="btnSubmit" runat="server" Text="提交" Width="95px" />
<asp:Button ID="btnEdit" runat="server" Text="编辑" Width="95px" />
<asp:Button ID="btnCancel" runat="server" Text="取消" Width="95px" /> </td>
</tr>
<tr>
<td style="height: 19px"> </td>
</tr>
</table>
</asp:View>
<asp:View ID="vFinish" runat="server"><br />
<p><b> <asp:Label ID="lbFinishMessage" runat="server"></asp:Label></b></p>
<asp:Panel ID="pReviewed" runat="server" Height="50px" Visible="False" Width="100%"> <div id ="Pannel">
<table width="600" class="ProductBox">
<tr>
<td colspan="2" style="height: 22px">
<Xpdt:Rater ID="Rater2" runat="server" DisplayOnly="True"></Xpdt:Rater>
<b>
<%=txtTitle.Text%>
</b>,
<%=String.Format("{0:f}", hfReviewDate.Value)%>
</td>
</tr>
<tr>
<td colspan="2">
<b>评论者:
<%=txtReviewer.Text%>
<%=IIf(txtLocation.Text.Length = 0, "", String.Format("({0})", txtLocation.Text))%>
</b>
</td>
</tr>
<tr>
<td colspan="3" style="width: 597px; height: 21px;">
<%=txtComments.Text%>
</td>
</tr>
<tr>
<td colspan="3" style="width: 597px; height: 40px">
<br />
<b>是否推荐给你的朋友:</b><%=IIf(CInt(rbComment.SelectedValue) = 0, "否", "是")%></td>
</tr>
</table></div>
</asp:Panel>
<p>
<b> <asp:HyperLink ID="hlBackProduct" runat="server">返回商品页</asp:HyperLink></b></p>
</asp:View>
</asp:MultiView></div>
<asp:HiddenField ID="hfProductID" runat="server" /><asp:HiddenField ID="hfReviewDate" runat="server" />
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?