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

How to use Radconfirm with hidden field in Ajax-enabled webform?

1 Answer 69 Views
Window
This is a migrated thread and some comments may be shown as answers.
LamKhoa
Top achievements
Rank 1
LamKhoa asked on 08 Jul 2011, 05:06 PM
Hi, I would like to have a confirm button. Here what I have done so far:

Code-Behind:

protected void btnClear_Click(object sender, EventArgs e)

 

{

    RadWindowManager1.RadConfirm(

 

"ARE YOU SURE WANT TO CLEAR THE SEARCH FORM?", "buttonConfirm",450, 150, null, "INFO");

 

 

 

    if (hdfConfirm.Value == "true")

 

    {

        resetSearchForm();

    }

    

 

 

}


Javascript:

function

 

 

buttonConfirm(arg)
{
    if (arg)
    {
        //Set hidden field (hdfConfirm) value to true

 

        document.getElementById("<%=hdfConfirm.ClientID%>").value =

 

"true";

 

    }

 

 

    else 
    {
        //Set hidden field (hdfConfirm) value to false

 

        document.getElementById("<%=hdfConfirm.ClientID%>").value =

 

"false";

 

    }
    $find("<%=RadAjaxManager1.ClientID%>").ajaxRequest(arg);


 

But it didn't work. Would you please check to see if I'm missing something here?

 

Thanks

Lamk



1 Answer, 1 is accepted

Sort by
0
LamKhoa
Top achievements
Rank 1
answered on 08 Jul 2011, 10:37 PM
Never mind. I have eventually figured it out by myself, if someone have similiar problem, here is the solution:

Code-Behind:

protected

 

 

void btnClear_Click(object sender, EventArgs e)

 {

    if (hdfConfirm.Value != "true" && hdfConfirm.Value != "false" )

        {

        RadWindowManager1.RadConfirm( "ARE YOU SURE WANT TO <B>CLEAR</B> THE SEARCH FORM?", "buttonConfirm", 450, 150, null, "INFO");

    }
    else if (hdfConfirm.Value == "true")

    {
        resetSearchForm();

        hdfConfirm.Value = "NULL";

    }

    else

    {

        hdfConfirm.Value = "NULL";

    }

}

Javascript:

function buttonConfirm(arg)

{

    if (arg)

    {

        document.getElementById(hdf).value =  "true";

        $find(ajaxManager).ajaxRequestWithTarget(buttonClear, '');

    }

    else

    {

        document.getElementById(hdf).value = "false";

    }

    document.getElementById(hdf).value = "Null Value";
}

Tags
Window
Asked by
LamKhoa
Top achievements
Rank 1
Answers by
LamKhoa
Top achievements
Rank 1
Share this question
or