I have a button for save record and now i want that when record is saved then open a popup window.
how can i do that.
for example:
This is just to explain, not actual code.
buttonClickEvent()
{
int id = SaveRecord();
OpenPopUp(id);
}
Regard.
3 Answers, 1 is accepted
0
Georgi Tunev
Telerik team
answered on 01 Sep 2008, 01:51 PM
Hi altaf,
To open a RadWindow from the codebehind you need to set its VisibleOnPageLoad property to true. More information on the subject is available in the documentation, section Controls / RadWindow / Programming / Setting Server-Side Properties.
Greetings,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I have set the radwindow VisibleOnPageLoad property to true and when the page_load event is called then window is opened but i don't want this functionality.
i want to open the popup when user click on a button then do some server side work (in my case i am inserting some data in db)
and then open the popup window.
i am doing like this but window is not being open.
int locationId = SaveLocation(name, lat, long,type);
I have done this,
Put ajax manager on the page and put javascript function on the .aspx or .ascx
like
<script type="text/javascript" >
function EditProduct(ProductId)
{
//Force reload in order to guarantee that the onload event handler of the dialog which configures it executes on every show.
var oWnd = window.radopen("PopUpEditProduct.aspx?ProductId="+ProductId, "RadWindow4");
oWnd.SetSize(1020,520);
oWnd.Center();
return false;
}
</script>
and the code behind the button_click() event is
int productId = SaveProduct();
RadAjaxManager1.ResponseScripts.Add("return EditProduct(" + productId + ")"); //it will open the popup.