# onClientClick

**URL:** <https://community.thinkgeo.com/t/onclientclick/6049>\
**Category:** WebForms\
**Created:** [December 7, 2011, 10:00am UTC](https://community.thinkgeo.com/t/onclientclick/6049 "2011-12-07T10:00:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shwe](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@shwe](https://community.thinkgeo.com/u/shwe)\
**Post date:** [December 7, 2011, 10:00am UTC](https://community.thinkgeo.com/t/onclientclick/6049/1 "2011-12-07T10:00:25Z")

</div>

Hello,

&nbsp;I&nbsp;&nbsp;have&nbsp;Visual&nbsp;Studio&nbsp;2010&nbsp;and&nbsp;I&nbsp;am&nbsp;using&nbsp;Map&nbsp;Shite&nbsp;Web&nbsp;Evaluation&nbsp;Edition&nbsp;5.0.

&nbsp;I&nbsp;have&nbsp;a&nbsp;very&nbsp;simple&nbsp;map&nbsp;showing&nbsp;the&nbsp;zip&nbsp;codes&nbsp;of&nbsp;NJ&nbsp;and&nbsp;I&nbsp;attached&nbsp;onClientClick&nbsp;event&nbsp;handler.

&nbsp;But&nbsp;it&nbsp;does&nbsp;not&nbsp;fire&nbsp;the&nbsp;event;&nbsp;instead&nbsp;I&nbsp;got&nbsp;the&nbsp;error&nbsp;on&nbsp;the&nbsp;javaScript&nbsp;file.

&nbsp;Would&nbsp;you&nbsp;please&nbsp;advise?

Thank&nbsp;you

shwe

`	        <asp:ScriptManager ID="ScriptManager1" runat="server">        </asp:ScriptManager>        <cc1:Map ID="Map1" runat="server" Height="480px" Width="640px" >        </cc1:Map>    `

for&nbsp;onClientClick&nbsp;I&nbsp;tried&nbsp;adding&nbsp;on&nbsp;both&nbsp;client&nbsp;side&nbsp;and&nbsp;server&nbsp;side

**Map1.OnClientClick&nbsp;=&nbsp;"function(map){alert('Client&nbsp;Click.');}";**

Please&nbsp;see&nbsp;attached&nbsp;image&nbsp;for&nbsp;error&nbsp;message.

![](https://community.thinkgeo.com/uploads/default/original/1X/928c7a2fd52dd5d6023086fd6ff9d08ee483a03d.GIF)

&nbsp;

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [December 7, 2011, 3:39pm UTC](https://community.thinkgeo.com/t/onclientclick/6049/2 "2011-12-07T15:39:08Z")

</div>

&nbsp;Hello&nbsp;shwe,

&nbsp;  
Please&nbsp;try&nbsp;this&nbsp;code,&nbsp;in&nbsp;server&nbsp;side:  
&nbsp;  
`Map1.OnClientClick = "mapClicked";`  
&nbsp;  
In&nbsp;client&nbsp;side:  
&nbsp;  
`function mapClicked(e) {            alert('Client Click.');        }`  
&nbsp;  
Regards,  
&nbsp;  
Gary

---

<div class="post-metadata">

**Author:** ![shwe](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@shwe](https://community.thinkgeo.com/u/shwe)\
**Post date:** [December 9, 2011, 10:20am UTC](https://community.thinkgeo.com/t/onclientclick/6049/3 "2011-12-09T10:20:00Z")

</div>

Thank&nbsp;you&nbsp;Gary.

shwe

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [December 9, 2011, 12:55pm UTC](https://community.thinkgeo.com/t/onclientclick/6049/4 "2011-12-09T12:55:03Z")

</div>

Hello&nbsp;shwe，&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;are&nbsp;welcome,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;when&nbsp;you&nbsp;meet&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
