Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Dynamically Insert Javascript? ajaxToolkit DynamicPopulateExtender

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andyr@addington.co.nz - 17 Mar 2008 05:22 GMT
I would like to dynamically insert a javascript call with with data
retrived from the database.

All I am trying to do is dynamically inserting the following <script
type="text/javascript">alert(retrieved_database_id);</script> to a
panel using the ajaxToolkit:DynamicPopulateExtender

Can someone enlighting me where I am going wrong or the best way to go
about what I am trying to achieve.

<ajaxToolkit:DynamicPopulateExtender ID="dp" BehaviorID="dp1"
runat="server" TargetControlID="panel1"
ClearContentsDuringUpdate="true" PopulateTriggerControlID="lbMessage"
ServiceMethod="GetDatabaseId" />

This is what I return from the webmethod:
public static string GetDatabaseId(string contextKey)
{
//Get retrived_database_id

return String.Format("<script  type=\"text/javascript\">alert({0});</
script>", retrived_database_id)
}

Thanks In Advance
Michael Nemtsev [MVP] - 17 Mar 2008 13:46 GMT
Hello andyr@addington.co.nz,

1) Do u use the latest March version of Toolkit?

2) Where are your
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]

attributes? or it's the PageMethod?

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

> I would like to dynamically insert a javascript call with with data
> retrived from the database.
[quoted text clipped - 16 lines]
> //Get retrived_database_id
> return String.Format("<script  type=\"text/javascript\">alert({0});</

script>> ", retrived_database_id)
script>>
> }
>
> Thanks In Advance

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.