HTML
<div id="EventContent" class="loading"/>
SCRIPT
$.ajax({
type: "POST",
url: "RSSReader.asmx/GetRSSReader",
data:
"{controlName:'events.ascx'}",
contentType: "application/json;
charset=utf-8",
dataType: "json",
success: function(data)
{
$('#EventContent').removeClass('loading').html(data);
}
});
APP_CODE
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo
=
WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public
class RSSReader : System.Web.Services.WebService {
[WebMethod]
public
string GetRSSReader(string controlName)
{
Page page = new
Page();
UserControl ctl =
(UserControl)page.LoadControl("~/controls/" +
controlName);
page.Controls.Add(ctl);
StringWriter writer = new
StringWriter();
HttpContext.Current.Server.Execute(page, writer,
false);
return writer.ToString();
}
}
Notice that the bold text is the parameter name and it have to be same. It is recommended to be string
6 comments:
I wish not agree on it. I assume polite post. Particularly the title-deed attracted me to review the intact story.
Genial post and this fill someone in on helped me alot in my college assignement. Thanks you seeking your information.
Hi
Very nice and intrestingss story.
Ι useԁ to be able to find good info from your
blοg poѕts.
My webpаge - Online Casino Bonus Spil i Danmark - Finding The very best Online Casino Perk
nike huarache
off white hoodie
fila shoes
nike shoes
hermes handbags
off white hoodie
nike kd 11
moncler jacket
yeezy boost 350
hermes bags
curry 6 shoes
curry 7
golden goose sneakers
golden goose sneakers
jordan 13
longchamps
jordan retro
moncler outlet
off white nike
kyrie 6 shoes
Post a Comment