473,770 Members | 5,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Insert Javascript? ajaxToolkit DynamicPopulate Extender

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">ale rt(retrieved_da tabase_id);</scriptto a
panel using the ajaxToolkit:Dyn amicPopulateExt ender

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

<ajaxToolkit:Dy namicPopulateEx tender ID="dp" BehaviorID="dp1 "
runat="server" TargetControlID ="panel1"
ClearContentsDu ringUpdate="tru e" PopulateTrigger ControlID="lbMe ssage"
ServiceMethod=" GetDatabaseId" />

This is what I return from the webmethod:
public static string GetDatabaseId(s tring contextKey)
{
//Get retrived_databa se_id

return String.Format(" <script type=\"text/javascript\">al ert({0});</
script>", retrived_databa se_id)
}

Thanks In Advance
Mar 17 '08 #1
1 2462
Hello an***@addington .co.nz,

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

2) Where are your
[System.Web.Serv ices.WebMethod]
[System.Web.Scri pt.Services.Scr iptMethod]

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.

All I am trying to do is dynamically inserting the following <script
type="text/javascript">ale rt(retrieved_da tabase_id);</scriptto a
panel using the ajaxToolkit:Dyn amicPopulateExt ender

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

<ajaxToolkit:Dy namicPopulateEx tender ID="dp" BehaviorID="dp1 "
runat="server" TargetControlID ="panel1"
ClearContentsDu ringUpdate="tru e" PopulateTrigger ControlID="lbMe ssage"
ServiceMethod=" GetDatabaseId" />

This is what I return from the webmethod:
public static string GetDatabaseId(s tring contextKey)
{
//Get retrived_databa se_id
return String.Format(" <script type=\"text/javascript\">al ert({0});</
script>", retrived_databa se_id)
script>>
}

Thanks In Advance

Mar 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4894
by: john_williams_800 | last post by:
Hi; I am just starting to use the DOM to do some more advanced javascripting so please be patient with my question if it is an ignorant question. I would like to use the DOM to dynamically create an html table via javascript. While that table is being dynamically created in a javascript function I would like to dynamically insert text and a hyperlink with an image into each cell.
2
2910
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to avoid the problem by avoiding the table control or resorting to databound controls that better manage state for me. I hope to understand how to solve the problem by using the Table web control and sticking to the approach of building the table at run...
4
2244
by: Jaime Stuardo | last post by:
Hi all... I need to add some JavaScript code that is dynamically generated to some point of the page. Currently I'm using ClientScript.RegisterStartupScript(GetType(), "menu", "<script type=\"text/javascript\">" + oMenu.BuildMenu(true, true, true) + "</script>"); But the script is added to the end of the page, but I need it to be added at
1
1154
by: sivagururaja | last post by:
Hi All, Im using ASP.NET with C#. (.NET 2005) In my page i want to allow the user to search the text from the SQL table. This is my table ID Name City State 1 Parry Chennai Tamilnadu
0
1591
by: chenhong | last post by:
I use a DynamicPopulateExtender to call a web service. And it's always return "web service fails". I find out it's because the return string of the web service it too long. Is there any ways to return a really long string with just one call? TIA
9
3380
by: Joshua | last post by:
I posted this originally in the csharp group, but I think that may be the wrong group. This seems more appropriate: I'm running into an issue with a memory leak in an Asp.Net web page. In the code behind (.cs) I'm adding onchange, onblur and onfocus events to a bunch of objects that reside on my page (textboxes and dropdownlist). After using Drip i've found that these are leaving open DOM objects.
3
1609
by: ma | last post by:
Hello, I download AJAXToolKit today and install it and configured my MSVC 2005 to use it. But there is no TabPanle control in it. I had an installation some month ago and it had TabPanel control in it. Can you please help me to find if it is a bug in AJAXToolKit You can help me by downloading the toolkit today and installing it and seeing if there is any TabPanel in the toolkit? I check everything and it seems that I am installing it...
1
4626
by: =?Utf-8?B?aUhhdkFRdWVzdGlvbg==?= | last post by:
I have downloaded ajax and this part of the code works fine in my new sample website <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" /> <asp:TextBox ID="txtTelerik" runat="server"></asp:TextBox> <asp:Button ID="btnTelerik" runat="server" Text="Show" /> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" CssClass="radcalendar" PopupButtonID="btnTelerik" Format="MMMM d, yyyy"...
7
6670
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.