0

アプリは.Netです。ハイパーリンクのクリックを記録したい。簡単です。これをリンク ボタンに変更し、必要なサーバー側コードを実行してクリックを記録できるようになりました。問題: _blank ターゲットへのリンクを起動できません。私は私のケーキを食べて、それも食べたいです。サーバー側コードと _blank ターゲット。どうやって?

4

1 に答える 1

0

以下を使用できます: ClientScriptManager.RegisterStartupScript メソッド (タイプ、文字列、文字列)

例えば。:

// Define the name and type of the client scripts on the page.
String csname1 = "PopupScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
StringBuilder cstext1 = new StringBuilder();
cstext1.Append("<script type=text/javascript>window.open(url, '_blank') </");
cstext1.Append("script>");
cs.RegisterStartupScript(cstype, csname1, cstext1.ToString());
于 2013-03-21T11:53:32.443 に答える