This is a migrated thread and some comments may be shown as answers.

open Popup on postback

3 Answers 128 Views
Window
This is a migrated thread and some comments may be shown as answers.
altaf
Top achievements
Rank 1
altaf asked on 30 Aug 2008, 06:53 AM
Hi,

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

Sort by
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.
0
altaf
Top achievements
Rank 1
answered on 22 Oct 2008, 06:44 AM

hello,

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);
 
lblInfo.Visible =

true;

 

lblInfo.ForeColor = System.Drawing.

Color.Black;

 

lblInfo.Text =

"Location Saved";

 

RadWindowManager1.VisibleOnPageLoad =

true;

 

 

btnAddNewLocation.Attributes.Add("onclick", "return EditLocation(" + locationId + ")");

my data is being saved but popup window not open.

please tell me that how can i do that.

Thanks.

 

0
altaf
Top achievements
Rank 1
answered on 28 Oct 2008, 09:51 AM
Hello,

 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.

Thanks.




Tags
Window
Asked by
altaf
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
altaf
Top achievements
Rank 1
Share this question
or