I want to display a pop up on each div click.the divs will create dynamically and each is boxes.I want to display some database values inside my pop up.I used hidden field(to get id) as a control parameter in sql datasource.To get the hidden field values on each click from c#,i used some _dopostback in javascript of my pop up plug in.
This causes page loading on every refresh and hence I cant display proper values in my popup on each click.
How can i avoid page refresh?
my javascript code:
in pop up function i called
__doPostBack('TestFunctionPostBack', comp_id);
c# code in page load
this.GetPostBackEventReference(this, string.Empty);
if (this.IsPostBack)
{
string eventTarget = (this.Request["__EVENTTARGET"] == null) ? string.Empty : this.Request["__EVENTTARGET"];
string eventArgument = (this.Request["__EVENTARGUMENT"] == null) ? string.Empty : this.Request["__EVENTARGUMENT"];
if (eventTarget == "TestFunctionPostBack")
{
HiddenField1.Value = eventArgument;
}
}
Use Ajax to call server side method and then render content on UI
Look at the following example http://weblogs.asp.net/craigshoemaker/archive/2008/09/29/using-jquery-to-call-asp-net-ajax-page-methods.aspx