views:

20

answers:

1

Hi, I have one usercontrol which contain one textbox, few buttons and one calander. I had place two instance of user control in one page as design time. It works fine all working from server side...mean server side events reference proper control at runtime.

Problem start after raising server side events from javascript. I succeed to fire proper event from javascript as per suggetion from other thread. Still I am not able to reference specific control at server side event. It always reference to control of last user control placed on page.

In my senerio I am firing calander's selected change event by buttons click event from javascript. The event fires as I want, but always it reference to last usercontrol's Calander.

Firing server side events from jabvascript is one step towards performance of user control.

Please suggest me.

A: 

Hi, I have the same sitution like you.

When I look at the source of the rendered page, I can see, that every usercontrol has its own javascript-function with references to the right asp.net-controls [I reference the ASP.NET-Controls in javascript by document.getElementById("<%= ANYCONTROL.ClientID %>") ].

Did you find a solution or is there someone out there, who can please help me/us???

Michael

Michael
Hi, Michael I succced to fire proper event or proper control by javascript. You can pass object like <asp:Button ... Onclick="javascript:DisplayCOntrol(this);" /> And You can do string operation on id of passed control and reference proper control id.
Naresh