我有一个带有一些文本的输入文本框,onclick事件我想运行一个javascript函数来选择(突出显示)此框中的所有文本,我如何用jquery做到这一点?
我在我的web.config文件中创建了一个配置部分,其中包含所有重写规则,如下所示
<rewrite>
<outboundRules>
<rule name="OutboundRewriteCatalogURL" preCondition="ResponseIsHtml1">
<match filterByTags="A" pattern="^(.*/)Catalog\.aspx\?Catalog=([^=&]+)&(?:amp;)?Title=([^=&]+)$" />
<action type="Rewrite" value="{R:1}ctlg/{R:2}/{R:3}/" />
</rule>
<rule name="OutboundRewriteCategoryURL" preCondition="ResponseIsHtml1">
<match filterByTags="A" pattern="^(.*/)ProductList\.aspx\?Catalog=([^=&]+)&(?:amp;)?Category=([^=&]+)&(?:amp;)?Title=([^=&]+)$" />
<action type="Rewrite" value="{R:1}categ/{R:2}/{R:3}/{R:4}/" />
</rule>
<rule name="OutboundRewriteFullProductURL" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^(.*/)Product\.aspx\?Catalog=([^=&]+)&(?:amp;)?Category=([^=&]+)&(?:amp;)?Product=([^=&]+)&(?:amp;)?Title=([^=&]+)$" />
<action type="Rewrite" value="{R:1}prd/{R:2}-{R:3}-{R:4}/{R:5}/" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
<rules>
<rule name="RedirectCatalogURL" stopProcessing="true">
<match url="^Catalog\.aspx$" />
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern="^Catalog=([^=&]+)&Title=([^=&]+)$" />
</conditions>
<action type="Redirect" url="Catalog/{C:1}/{C:2}" appendQueryString="false" />
</rule>
<rule name="RewriteCatalogURL" stopProcessing="true">
<match url="^ctlg/([^/]+)/([^/]+)/?$" …Run Code Online (Sandbox Code Playgroud) 我有以下问题.
我有一些的DateTime属性的对象,并在数据库中的表,我储存的所有对象,在SQL Server中我要存储日期时间数据类型的一些列的日期时间属性,但在SQL Server日期时间的格式是不同的c#中的DateTime类,我得到一个sql异常,说"无法解析DateTime".我知道如何通过使格式YYYY-MM-DD解决这个但这是正确的和最佳的解决方案,这样做吗?
public void UpdateInvitation(string ownerId, string couponKey, string status, string invitedEmail, DateTime? sentDate, DateTime? redeemedDate)
{
using (var con = new SqlConnection(this.ConnectionString))
{
try
{
con.Open();
var command =
new SqlCommand(
"UPDATE INVITATIONS SET Status='@status', InvitedEmail='@invitedEmail', SentDate='@sentDate', RedeemDate='@redeemedDate' WHERE CouponKey='@CouponKey' AND OwnerId='@OwnerId'");
var ownerIdParam = new SqlParameter("@ownerId", ownerId);
var couponKeyParam = new SqlParameter("@couponKey", couponKey);
var statusParam = new SqlParameter("@status", status);
var invitedEmailParam = new SqlParameter("@invitedEmail", invitedEmail);
var sentDateParam = new SqlParameter("@sentDate", sentDate.Value) { SqlDbType = SqlDbType.DateTime }; …Run Code Online (Sandbox Code Playgroud)