I took a look at the example below...Which is similar to what I want..
http://demos.telerik.com/aspnet-ajax/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx
Now I have a delete button...On Delete Button click I need a confirm that User is sure to delete
if he is sure then i run code -behind to delete the stuff and after deleting I need to the user to know
that delete in confrmed
http://demos.telerik.com/aspnet-ajax/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx
Now I have a delete button...On Delete Button click I need a confirm that User is sure to delete
if he is sure then i run code -behind to delete the stuff and after deleting I need to the user to know
that delete in confrmed
7 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 10 Dec 2008, 04:39 AM
Hi Dip,
RadConfirm just as the standard confirm works on the client. Therefore, to perform any actions on the server side after selecting Yes/No, it requires a postback to the server.
One possible suggection for this is by placing an invisible server button on the page and then in the JavaScript callback function of radconfirm to invoke the "click" event of the button which will cause a postback. Then, in the event handler of the button you can perform the server side actions. Try the code snippets below.
ASPX:
CSS:
Thanks,
Princy.
RadConfirm just as the standard confirm works on the client. Therefore, to perform any actions on the server side after selecting Yes/No, it requires a postback to the server.
One possible suggection for this is by placing an invisible server button on the page and then in the JavaScript callback function of radconfirm to invoke the "click" event of the button which will cause a postback. Then, in the event handler of the button you can perform the server side actions. Try the code snippets below.
ASPX:
<style type="text/css"> |
.buttons |
{ |
display:none |
} |
</style> |
<asp:Button ID="Button1" runat="server" Text="Button" CssClass="buttons" onclick="Button1_Click" /> |
<asp:Button ID="Button2" runat="server" Text="Button" CssClass="buttons" onclick="Button2_Click" /> |
<button onclick = "radconfirm('Are you sure?', confirmCallBackFn); return false;"> Delete</button> |
<script language="javascript" type="text/javascript"> |
function confirmCallBackFn(arg) |
{ |
if (arg) |
{ |
__doPostBack("<%= Button1.ClientID %>",""); |
alert("Deleted"); |
} |
else |
{ |
__doPostBack("<%= Button2.ClientID %>",""); |
} |
} |
</script> |
CSS:
protected void Button1_Click(object sender, EventArgs e) |
{ |
//Clicked Ok. Code for Deleting |
} |
protected void Button2_Click(object sender, EventArgs e) |
{ |
//Clicked Cancel. |
} |
Thanks,
Princy.
0
Dip
Top achievements
Rank 1
answered on 10 Dec 2008, 05:19 AM
This didn't do the trick....
Microsoft JScript runtime error: Object expected
Thanks,
DIP
Microsoft JScript runtime error: Object expected
Thanks,
DIP
0
Princy
Top achievements
Rank 2
answered on 10 Dec 2008, 06:07 AM
Hallo Dip,
A RadWindowManager must be present on the form for you to use the radalert, radconfirm, and radprompt dialogs. Please make sure that you added RadWindowManager on page.
ASPX:
Regards,
Princy.
A RadWindowManager must be present on the form for you to use the radalert, radconfirm, and radprompt dialogs. Please make sure that you added RadWindowManager on page.
ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
</telerik:RadWindowManager> |
Regards,
Princy.
0
Dip
Top achievements
Rank 1
answered on 12 Dec 2008, 03:12 AM
After the server side code sucess...I what to put a pop that says sucessfull....something like that ...
if(go)
{
//Serve side processing...
}
else
{
}
I can't get the result I want..?
What am I missing?
if(go)
{
//Serve side processing...
ScriptManager
.RegisterStartupScript(this.Page, typeof(Page), "Test1", "<script type='text/javascript'>alert();</script>", true);//For the pop after the it return to the Browser..
}
else
{
}
I can't get the result I want..?
What am I missing?
0
Marty
Top achievements
Rank 1
answered on 12 Dec 2008, 04:16 AM
>> A RadWindowManager must be present on the form for you to use the radalert, radconfirm, and radprompt dialogs. Please make sure that you added RadWindowManager on page.
That was the most important piece of info missing from all your demos.
I spent about an hour trying to figure out how your .js was being emitted.
Can you update your demo intros?
Your controls are great but you are still falling into the trap of microsoft and infragisitcs. We want total control with these controls. I want to be able to popup a window from the server side and show a message and unfortunately, I have to use javascript and crack my knuckles to make it work. This stuff should be easier than that. It took me about two hours to make a double-click server side event for the RadGrid. Why do you guys leave out such common frequent stuff?
Your examples should start showing how stuff works on content pages hosted by master pages. No one writes a single page web site anymore. But your examples are 1000% better than your competition.
take this with a grain of salt - it just bummed because I had to read on your forums why my radalert simple stupid example was not doing anything.
That was the most important piece of info missing from all your demos.
I spent about an hour trying to figure out how your .js was being emitted.
Can you update your demo intros?
Your controls are great but you are still falling into the trap of microsoft and infragisitcs. We want total control with these controls. I want to be able to popup a window from the server side and show a message and unfortunately, I have to use javascript and crack my knuckles to make it work. This stuff should be easier than that. It took me about two hours to make a double-click server side event for the RadGrid. Why do you guys leave out such common frequent stuff?
Your examples should start showing how stuff works on content pages hosted by master pages. No one writes a single page web site anymore. But your examples are 1000% better than your competition.
take this with a grain of salt - it just bummed because I had to read on your forums why my radalert simple stupid example was not doing anything.
0
Dip
Top achievements
Rank 1
answered on 12 Dec 2008, 05:38 AM
I already Have RadWindowManager....
0
Hello Dip,
Please open a new support ticket and send us your implementation so far so we can check what is your exact setup and find the reason for the error.
Marty, thank you for the feedback. Indeed, this information is not present in the "Alert, Prompt, Confirm" demo:
http://demos.telerik.com/aspnet-ajax/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx
(it is present in the documentation though - section Controls > RadWindow > Predefined Dialogs > Alert, Confirm, And Prompt Dialogs)
I will make sure that the information in the demo is updated as well. As for implementing a double-click in RadGrid, I don't know if you have checked this example, but I believe it will be of help:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/DataEditing/EditOnDblClick/DefaultCS.aspx
Sincerely yours,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Please open a new support ticket and send us your implementation so far so we can check what is your exact setup and find the reason for the error.
Marty, thank you for the feedback. Indeed, this information is not present in the "Alert, Prompt, Confirm" demo:
http://demos.telerik.com/aspnet-ajax/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx
(it is present in the documentation though - section Controls > RadWindow > Predefined Dialogs > Alert, Confirm, And Prompt Dialogs)
I will make sure that the information in the demo is updated as well. As for implementing a double-click in RadGrid, I don't know if you have checked this example, but I believe it will be of help:
http://demos.telerik.com/aspnet-ajax/Grid/Examples/DataEditing/EditOnDblClick/DefaultCS.aspx
Sincerely yours,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.