Hi,
I'm displaying a RadNotification control from within an async postback. The markup for the RadNotification looks like this:
My code behind looks like this:
I'm able to set the Text property but not able to set the Title and TitleIcon properties. Am I missing something or is this not possible?
Thanks -- Steve
I'm displaying a RadNotification control from within an async postback. The markup for the RadNotification looks like this:
<
telerik:RadNotification
ID
=
"AddToCartNotification"
runat
=
"server"
Animation
=
"Fade"
AutoCloseDelay
=
"5000"
ContentIcon
=
""
Height
=
"100px"
Opacity
=
"80"
Position
=
"Center"
Skin
=
"Forest"
Width
=
"300px"
EnableRoundedCorners
=
"True"
EnableShadow
=
"True"
LoadContentOn
=
"EveryShow"
oncallbackupdate
=
"AddToCartNotification_CallbackUpdate"
Title
=
"Add to Cart Result"
/>
My code behind looks like this:
protected void OnVideoRepeaterItemCommand(object source, RepeaterCommandEventArgs e)
{
switch (e.CommandName)
{
case "AddToCart":
{
AddItemToCart((string)e.CommandArgument);
break;
}
}
}
private void AddItemToCart(string productSku)
{
ShoppingCartUtilities.AddToCartResult result = ShoppingCartUtilities.AddItemToCart(productSku, 1, 1);
string caption = "";
string msg = "";
string icon = "";
if (result == ShoppingCartUtilities.AddToCartResult.ItemAddSucceeded)
{
icon = "info";
caption = "Item Added";
msg = "Item successfully added to cart";
}
else if (result == ShoppingCartUtilities.AddToCartResult.ItemAddFailedMaxItemCountReached)
{
icon = "warning";
caption = "Maximum Count for Item Reached";
msg = "Only one copy of this video can be added to your cart";
}
else
{
icon = "deny";
caption = "Unable to Add Item to Cart";
msg = "Add to cart failed. Sorry for the inconvenience";
}
string value = string.Format("{0}|{1}|{2}", icon, caption, msg);
AddToCartNotification.Value = value;
AddToCartNotification.Show();
}
protected void AddToCartNotification_CallbackUpdate(object sender, Telerik.Web.UI.RadNotificationEventArgs e)
{
RadNotification notification = sender as RadNotification;
if(notification == null)
return;
string[] vals = notification.Value.Split('|');
if (vals == null || vals.Length < 3)
return;
AddToCartNotification.TitleIcon = vals[0];
AddToCartNotification.Title = vals[1];
//AddToCartNotification.ContentIcon = vals[0];
AddToCartNotification.Text = vals[2];
}
I'm able to set the Text property but not able to set the Title and TitleIcon properties. Am I missing something or is this not possible?
Thanks -- Steve