Monday, March 26, 2012

Call out

I want to create a call out on mouse over. I have some small text on a page and when you mouse over it i want it to do a call out. so the text i big. Can this be done?

Thanks
Mike

Mike,

You may want to think about a Javascript solution like the one here:http://www.dynamicdrive.com/dynamicindex5/popinfo2.htm


how would i do that with data from a database?

Mike


Hi Mike ,
I think you can add a WebService to your page and the WebService will get the result from your Database. Here is the sample shows how to use Call a WebService on the client. The sample is written by Jerferry zhao.

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Services>
<asp:ServiceReference Path="Services/UseHttpGetService.asmx" InlineScript="true" />
</Services>
</asp:ScriptManager>

<input type="button" value="Get Random" onclick="getRandom()" />
<input type="button" value="Get Range Random" onclick="getRandom(50, 100)" />

<script language="javascript" type="text/javascript">
function getRandom(minValue, maxValue)
{
if (arguments.length != 2)
{
UseHttpGetService.GetRandom(onSucceeded);
}
else
{
UseHttpGetService.GetRangeRandom(minValue, maxValue, onSucceeded);
}
}

function onSucceeded(result)
{
alert(result);
}
</script>

WebService

<%@. WebService Language="C#" Class="UseHttpGetService" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class UseHttpGetService : System.Web.Services.WebService
{
[WebMethod]
public int GetRandom()
{
return new Random(DateTime.Now.Millisecond).Next();
}

[WebMethod]
[ScriptMethod(UseHttpGet=true)]
public int GetRangeRandom(int minValue, int maxValue)
{
return new Random(DateTime.Now.Millisecond).Next(minValue, maxValue);
}
}

I hope this help.

Best regards,

Jonathan

No comments:

Post a Comment