protected void LinkClicked(object sender, LinkTableEventArgs e)
    {
        lblInfo.Text = "You clicked '" + e.SelectedItem.Text +

                       "' but this page chose not to direct you to '" +
                       e.SelectedItem.Url + "'.";
        e.Cancel = true;
    }
コード例 #2
0
ファイル: LinkTableHost.aspx.cs プロジェクト: Helen1987/edu
	protected void LinkClicked(object sender, LinkTableEventArgs e)
	{
		lblInfo.Text = "You clicked '" + e.SelectedItem.Text +

		  "' but this page chose not to direct you to '" +
		e.SelectedItem.Url + "'.";
		e.Cancel = true;
	}
コード例 #3
0
    protected void gridLinkList_LinkClicked(object sender, GridViewCommandEventArgs e)
    {
        if (LinkClicked != null)
        {
            // Get the LinkButton object that was clicked.
            LinkButton link = (LinkButton)e.CommandSource;

            // Construct the event arguments.
            LinkTableItem      item = new LinkTableItem(link.Text, link.CommandArgument);
            LinkTableEventArgs args = new LinkTableEventArgs(item);

            // Fire the event.
            LinkClicked(this, args);

            // Navigate to the link if the event recipient didn't
            // cancel the operation.
            if (!args.Cancel)
            {
                Response.Redirect(item.Url);
            }
        }
    }
コード例 #4
0
ファイル: LinkTable.ascx.cs プロジェクト: Helen1987/edu
	protected void listContent_ItemCommand(object source,
	  System.Web.UI.WebControls.DataListCommandEventArgs e)
	{
		if (LinkClicked != null)
		{
			// Get the HyperLink object that was clicked.
			LinkButton link = (LinkButton)e.Item.Controls[1];

			// Construct the event arguments.
			LinkTableItem item = new LinkTableItem(link.Text, link.CommandArgument);
			LinkTableEventArgs args = new LinkTableEventArgs(item);

			// Fire the event.
			LinkClicked(this, args);

			// Navigate to the link if the event recipient didn't
			// cancel the operation.
			if (!args.Cancel)
			{
				Response.Redirect(item.Url);
			}
		}
	}