我如何计算没有点击特定链接的次数. [英] How I Can Count No Of Click On A Particular Link..

查看:74
本文介绍了我如何计算没有点击特定链接的次数.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

my Aspx page...

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type ="text/javascript">
function Demand(regid) {
window.open("CustomerReport.aspx?Id=" + regid, 'Define', 'width=1000,height=600,left=0,top=0,scrollbars=yes,resizable=yes,menubar=yes');
}
</script>
<style type="text/css">
.style1
{
width: 100%;
border: 1px solid #000000;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="background:url(sweet3.jpg) no-repeat; background-size:cover; width:100%; height:678px; margin-top: 0px;">
<div style="height: 127px; width: 463px; margin-left:50px; padding-top:100px">
<table class="style1">
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Label ID="Label1" runat="server" Text="Mobile Number"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server" style=" float:left" Text="Search"

onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" style=" float:right" Text="clear"

onclick="Button2_Click" />
</td>
<td>
&nbsp;</td>
</tr>
</table>
</div>

<div style="height:auto; width:auto; margin-left:20px; padding-top:100px">

<asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False" AllowPaging="False"

AllowSorting="true" DataSourceID="dsDetails" Width="100%" class="grid-bg"  DataKeyNames="name" >
<HeaderStyle BackColor="#df5015" />
<Columns>

<asp:TemplateField HeaderText="Mobile">
<ItemTemplate>
<asp:Label ID="Customerid" Text='<%# HighlightText(Eval("mobile").ToString()) %>' runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemTemplate>
<asp:Label ID="lblCID" Text='<%# Eval("address") %>' runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<%--<asp:Label ID="Email" Text='<%# Eval("Email") %>' runat="server"/>--%>
<asp:HyperLink ID="HyperLink1" runat="server" style=" color:Blue"

Text='<%# Eval("name") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Last Order Date">
<ItemTemplate>
<asp:Label ID="lblFname" Text='<%# Eval("lastdate") %>' runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Last Order Status">
<ItemTemplate>
<asp:Label ID="lblLastStatus" Text='<%#Eval("status") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cancel due to">
<ItemTemplate>
<asp:Label ID="lblcustomertype" Text='<%# Eval("cancel") %>' runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Remark">
<ItemTemplate>
<asp:Label ID="lblcustomerCategory" Text='<%# Eval("remark") %>' runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<a href="#" id="lnkdetailbtn" onclick="Demand('<%# DataBinder.Eval(Container,"DataItem.mobile") %>');" btn_Click class="left" >Show Details</a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

</div>
<asp:SqlDataSource ID="dsDetails" runat="server" ConnectionString="<%$ConnectionStrings:conn %>" SelectCommand="select * from Sheet1$" FilterExpression="name LIKE '%{0}%' " >
<FilterParameters>
<asp:ControlParameter Name="mobile" ControlID="txtSearch" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>

Coding page..


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Text.RegularExpressions;

public partial class Search : System.Web.UI.Page
{
private string SearchString = "";
protected void Page_Load(object sender, EventArgs e)
{

}
public string HighlightText(string InputTxt)
{
string Search_Str = txtSearch.Text;
// Setup the regular expression and add the Or operator.
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
// Highlight keywords by calling the
//delegate each time a keyword is found.
return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
}

public string ReplaceKeyWords(Match m)
{
return ("<span class=highlight>" + m.Value + "</span>");
}
protected void Button1_Click(object sender, EventArgs e)
{
SearchString = txtSearch.Text;
}
protected void Button2_Click(object sender, EventArgs e)
{
txtSearch.Text = "";
SearchString = "";
gvDetails.DataBind();
}
}


i want to know how i can find out that how many time a person click on show detail link.. plz help me out.. its really urgent.. plz plz.

推荐答案

连接字符串:conn %> " SelectCommand ="
ConnectionStrings:conn %>" SelectCommand="select * from Sheet1


" FilterExpression 名称类似'%{0}%'" > < FilterParameters > < asp:ControlParameter 名称 =" ControlID txtSearch " PropertyName 文本" / < /FilterParameters > < /asp:SqlDataSource > < /div > < /form > < /body > < /html > 编码页 使用系统; 使用System.Collections; 使用System.Configuration; 使用System.Data; 使用System.Linq; 使用System.Web; 使用System.Web.Security; 使用System.Web.UI; 使用System.Web.UI.HtmlControls; 使用System.Web.UI.WebControls; 使用System.Web.UI.WebControls.WebParts; 使用System.Xml.Linq; 使用System.Data.SqlClient; 使用System.Text.RegularExpressions; 公共局部类搜索:System.Web.UI.Page { 私有字符串SearchString ="; 受保护的void Page_Load(对象发送者,EventArgs e) { } 公共字符串HighlightText(string InputTxt) { 字符串Search_Str = txtSearch.Text; //设置正则表达式并添加Or运算符. Regex RegExp =新Regex(Search_Str.Replace(","|").Trim(),RegexOptions.IgnoreCase); //通过调用 //每次找到关键字时委托. 返回RegExp.Replace(InputTxt,新的MatchEvaluator(ReplaceKeyWords)); } 公共字符串ReplaceKeyWords(匹配m) { return(" span = 突出显示 /span > ); } 受保护的void Button1_Click(对象发送者,EventArgs e) { SearchString = txtSearch.Text; } 受保护的void Button2_Click(对象发送者,EventArgs e) { txtSearch.Text ="; SearchString ="; gvDetails.DataBind(); } } 我想知道如何找出一个人单击显示详细信息"链接有多少次..plz帮助我..这真的很紧急..plz plz.
" FilterExpression="name LIKE '%{0}%' " > <FilterParameters> <asp:ControlParameter Name="mobile" ControlID="txtSearch" PropertyName="Text" /> </FilterParameters> </asp:SqlDataSource> </div> </form> </body> </html> Coding page.. using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Text.RegularExpressions; public partial class Search : System.Web.UI.Page { private string SearchString = ""; protected void Page_Load(object sender, EventArgs e) { } public string HighlightText(string InputTxt) { string Search_Str = txtSearch.Text; // Setup the regular expression and add the Or operator. Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase); // Highlight keywords by calling the //delegate each time a keyword is found. return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords)); } public string ReplaceKeyWords(Match m) { return ("<span class=highlight>" + m.Value + "</span>"); } protected void Button1_Click(object sender, EventArgs e) { SearchString = txtSearch.Text; } protected void Button2_Click(object sender, EventArgs e) { txtSearch.Text = ""; SearchString = ""; gvDetails.DataBind(); } } i want to know how i can find out that how many time a person click on show detail link.. plz help me out.. its really urgent.. plz plz.


快速搜索
A quick search on Google[^], gives us About 12,40,00,000 results (0.39 seconds).

Please try something and come back on Code Project with a specific Question.


这篇关于我如何计算没有点击特定链接的次数.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆