Some one help me !

Latest post Mon, Jun 30 2008 9:38 PM by phuocle. 2 replies.
  • Sun, Jun 29 2008 12:09 PM

    • phuocle
    • Not Ranked
    • Joined on Wed, Sep 19 2007
    • Posts 11
    • Points 100

    Some one help me !

    Hi All

    I have a textbox and a button, a buton when click it display the contentselector modal dialog. When user click OK on this dialog, it closed and it assign the url to textbox ? Just easy, but it take me a lot of works. Please help me !

    I can code the OnClick in the button:

    string url = SiteUrls.Instance().ContentSelectorModal;
    SelectButton.Attributes["OnClick"] = CommunityServer.Controls.ModalHelper.BuildHandler(this.Page, url, 600, 400, "AAAAAAAAA", true);


    The AAAAAAAAA text I know this is a callback function. But I don't know how to write it. :(

    Please help me write the callback function when the modal dialog close. And it assign the url to the textbox.

    Thanks.

     

    Filed under:
    • Post Points: 20
  • Mon, Jun 30 2008 9:54 AM In reply to

    • Ben Tiedt
    • Top 10 Contributor
    • Joined on Tue, Nov 8 2005
    • Michigan
    • Posts 3,330
    • Points 66,010
    • CS Developers

    Re: Some one help me !

    Reply |Contact |Answer

    Instead of using the SiteUrl directly, I'd suggest using the static method:

    SelectButton.Attributes["OnClick"] = CommunityServer.Controls.SelectContentForm.GetOpenScript("SET CONTENT SCRIPT") + "; return false;";

    where SET CONTENT SCRIPT is a javascript script that will be executed with a variable called "content" containing the selected content, such as:

    "alert(content);"

    which would alert the source of the selected content.

    Ben Tiedt's Blog

    • Post Points: 20
  • Mon, Jun 30 2008 9:38 PM In reply to

    • phuocle
    • Not Ranked
    • Joined on Wed, Sep 19 2007
    • Posts 11
    • Points 100

    Re: Some one help me !

    Thanks. Problem fixed.

     

    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com