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(retriev
ed_databas
e_id);</sc
ript> to a panel using the ajaxToolkit:DynamicPopulat
eExtender
Can someone enlighting me where I am going wrong or the best way to go about what I am trying to achieve.
<ajaxToolkit:DynamicPopula
teExtender
ID="dp" BehaviorID="dp1" runat="server" TargetControlID="panel1" ClearContentsDuringUpdate=
"true" PopulateTriggerControlID="
lbMessage"
ServiceMethod="GetDatabase
Id" />
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\">a
lert({0});
</script>"
, retrived_database_id)
}
Thanks In Advance
Start Free Trial