Hi, I have an issue. When i click on Radbutton1, i want a prompt to tell me that i have successfully uploaded the picture. How can i do it?
I tried ways like -
RadWindowManager1.RadAlert("Event's picture changed!", 200, 100, "Change Image", "callBackFn")
but it doesnt seems to work too.
Thanks.
I tried ways like -
RadWindowManager1.RadAlert("Event's picture changed!", 200, 100, "Change Image", "callBackFn")
but it doesnt seems to work too.
Thanks.
4 Answers, 1 is accepted
0
Hello Sherman,
I believe that this issue is due to the apostrophe in the alert's message. Since this string passes through JavaScript this results in a JavaScript error. You would need to escape such symbols properly. In this case it has to be done with a backslash in the JavaScript, so you would need it to be present in the string that goes to the client. This means that you could put two backslashes in the C# code to achieve this. You can find my test page with this modification attached and it seems to be working fine on my end: http://screencast.com/t/XA7okLfxk.
I would also advise that you examine our new control - RadNotification, as this is its intended purpose - to provide the user with notifications. I would suggest that you start with the following online demos and see if it functionality matches your needs:
http://demos.telerik.com/aspnet-ajax/notification/examples/show/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/notification/examples/callback/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/notification/examples/configurator/defaultcs.aspx
All the best,
Marin
the Telerik team
I believe that this issue is due to the apostrophe in the alert's message. Since this string passes through JavaScript this results in a JavaScript error. You would need to escape such symbols properly. In this case it has to be done with a backslash in the JavaScript, so you would need it to be present in the string that goes to the client. This means that you could put two backslashes in the C# code to achieve this. You can find my test page with this modification attached and it seems to be working fine on my end: http://screencast.com/t/XA7okLfxk.
I would also advise that you examine our new control - RadNotification, as this is its intended purpose - to provide the user with notifications. I would suggest that you start with the following online demos and see if it functionality matches your needs:
http://demos.telerik.com/aspnet-ajax/notification/examples/show/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/notification/examples/callback/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/notification/examples/configurator/defaultcs.aspx
All the best,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Luffy
Top achievements
Rank 1
answered on 03 Aug 2011, 05:39 PM
Hello, what i need for this radalert is when I clicked on the button. If the textbox is nothing, it will alert that textbox is empty and if there's something in the textbox , it will prompt that upload success.
How can i achieve that?
Thanks
How can i achieve that?
Thanks
0
Luffy
Top achievements
Rank 1
answered on 03 Aug 2011, 05:51 PM
By the way, im not using C# but VB
0
Shinu
Top achievements
Rank 2
answered on 04 Aug 2011, 05:58 AM
Hello Sherman,
Try the following scenario to change the alert message from serverside.
VB:
JS:
Thanks,
Shinu.
Try the following scenario to change the alert message from serverside.
VB:
Protected
Sub
btnToggle1_Click(sender
As
Object
, e
As
EventArgs)
If
txtUsername.Text =
""
Then
RadWindowManager1.RadAlert(
"Nothing"
, 330, 100,
"Server RadAlert"
,
"alertCallBackFn"
)
Else
RadWindowManager1.RadPrompt(
"Server RadPrompt: Upload Success"
,
"CallBackFn"
, 330, 160,
Nothing
,
"Server RadPrompt"
, _
"42"
)
End
If
End
Sub
JS:
function
alertCallBackFn(arg)
{
radalert(
"<strong>radalert</strong> returned the following result: <h3 style='color: #ff0000;'>"
+ arg +
"</h3>"
,
null
,
null
,
"Result"
);
}
function
CallBackFn(arg)
{
radprompt(
"<strong>radprompt</strong> returned the following result: <h3 style='color: #ff0000;'>"
+ arg +
"</h3>"
,
null
,
null
,
"Result"
);
}
Thanks,
Shinu.