PC Review


Reply
Thread Tools Rate Thread

ajax and asp.net in user control

 
 
olivier
Guest
Posts: n/a
 
      31st Jan 2007
Hi,

I want to use javascript (ajax) in User Control but to call
the object is difficult.

If my user control is called MyControl.
To use the object in javascript, i make,

Ex:
document.GetElementId("MyControl_textbox").value

Have you an idea to get the name of the user control asp.net
to instance my code javascript cause the same code javascript must to work
in other User control.

Thank's
Olivier
ps : excuse me for my poor english.

 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      31st Jan 2007
"olivier" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> document.GetElementId("MyControl_textbox").value

document.GetElementId('<%=MyControl_textbox.ClientID%>').value;

> ps : excuse me for my poor english.

Pas de quoi...:-)


 
Reply With Quote
 
olivier
Guest
Posts: n/a
 
      31st Jan 2007
Thank's

I had not thought of it

But it's more portable if i write

document.GetElementId('<%=Page.Findcontrol("MyTextBox").ClientID%>').value;

What do you think ?

Olivier
"Mark Rae" <(E-Mail Removed)> a écrit dans le message de news: %(E-Mail Removed)...
"olivier" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> document.GetElementId("MyControl_textbox").value

document.GetElementId('<%=MyControl_textbox.ClientID%>').value;

> ps : excuse me for my poor english.

Pas de quoi...:-)



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      31st Jan 2007
"olivier" <(E-Mail Removed)> wrote in message
news:%23%(E-Mail Removed)...

>But it's more portable if i write
>
>document.GetElementId('<%=Page.Findcontrol("MyTextBox").ClientID%>').value;
>
>What do you think ?


I don't think it will make much difference...

However, something that I missed in my previous reply and which I've just
spotted now is that it's getElementById, not getElementId


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX User Control Event's not firing... Dan Bass Microsoft ASP .NET 1 9th Jul 2008 08:57 PM
AJAX User Control Event's not firing... Dan Bass Microsoft Dot NET Compact Framework 2 9th Jul 2008 08:57 PM
AJAX User Control Event's not firing... Dan Bass Microsoft C# .NET 1 5th Jul 2008 09:56 AM
AJAX with asp.net user control Paras Microsoft ASP .NET 2 17th Apr 2007 06:19 AM
ajax and asp.net in user control olivier Microsoft ASP .NET 1 30th Jan 2007 07:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:58 AM.