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

Server side popup issue on a link button

1 Answer 76 Views
Button
This is a migrated thread and some comments may be shown as answers.
FireHolster
Top achievements
Rank 1
FireHolster asked on 05 Aug 2011, 10:46 PM

i am running into a problem of returning a server side popup. here's my situation

 

1. I am having a grid with a edit command column as

       <telerik:GridEditCommandColumn UniqueName="actions" EditText="Go" ButtonType="PushButton">

            </telerik:GridEditCommandColumn>

2. the editform settings are

       <EditFormSettings PopUpSettings-Modal="true" InsertCaption="Actions" EditFormType="Template">

            <FormTemplate>

                <Action:actions ID="something" runat="server" />

            </FormTemplate>

        </EditFormSettings>

 

3. on the click of of the go button the popup displays a user control

4. on the user control i am displaying a list of link buttons ( can use any of the buttons rad or asp)

5. on the click of the link on the popup i want to navigate to a url built on the code behind for each button.

prior to  navigating to the url, i have to check if the some variables are valid or not for e.g.

if(x is true)

ask user a (some custom message as: this is the situation want to continue)

if user say yes navigate to the url otherwise do nothing or close the edit form popup.

 

the message is different for each linkbutton on the page.

 

I have tried few things nothing seems to be working (frustrated)
on the onclick of the link button, in the code behind:

1. tried using the scriptmanager in code behind as and call the confirmation method by passing in the messga parameter

string messgae = "some messagae"

 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "confirmation('&message&')", true);

 

this returns object not defined errorsonce the link is clicked

2. tried

string message = "so ethnugsa";

Page.ClientScript.RegisterStartupScript(this.GetType(), "radConfirm", "radConfirm('"message"', 200,200);", true);

 

not displaying any popup???? and am not sure even if it displays how would i be restricting the user to not navigate on cancel or No click on the popup.

 

 

helppppppp

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Aug 2011, 06:57 AM
Hello Bikrant,

I tried the following scenario and it worked on my end.Make sure that you have RadWindowManager defined as well.
aspx:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
C#:
protected void Button1_Click(object sender, EventArgs e)
{
  string radconfirmscript = "<script language='javascript'>function f(){radconfirm('Welcome', 330, 210); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
  Page.ClientScript.RegisterStartupScript(this.GetType(), "radconfirm", radconfirmscript);
}

Thanks,
Shinu.
Tags
Button
Asked by
FireHolster
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or