2016-04-02 5 views
0

とC#の関数を呼び出す:は、私は自分のWebページ内の画像上のコードのこの部分を持っている<map>タグ

<map name="mapWouldYouRather"> 
    <area shape="rect" coords="0,0,460,260" alt="GuessBlue" href="Index.aspx"/> 
    <area shape="rect" coords="470,0,930,260" alt="GuessRed" href="Index.aspx"/> 
</map> 

、私は地域の一つの代わりにクリックしたときにどのような方法は、C#の関数を呼び出すありそれを特定のWebページにリンクしていますか?

答えて

1

hrefの代わりにonclickを使用して、GETまたはPOSTリクエストをサーバーに送信するjavascript関数を呼び出すことができます。

<map name="mapWouldYouRather"> 
    <area shape="rect" coords="0,0,460,260" alt="GuessBlue" onclick="myJsFunction()"/> 
    <area shape="rect" coords="470,0,930,260" alt="GuessRed" onclick="myJsFunction()"/> 
</map> 
関連する問題