Forums

change attributes for the server controls with javascript

Last post 11/21/2008 2:25 AM by Alexander Yaremchuk. 5 replies.
Sort Posts: Previous Next
  • hankach abdelaziz

    change attributes for the server controls with javascript

    8/25/2008 11:51 AM
    • Not Ranked
    • Joined on 8/22/2008
    • Posts 10

     <script language="javascript" type="text/javascript">

    function

    DisableMe() {

     

    btn.Enabled = false;

    <

    dxe:ASPxButton ID="ASPxButton1" runat="server" Text="ASPxButton" ClientInstanceName ="btn">

     

    <ClientSideEvents Click="function(s, e) {

     

    ClientSideEvents>

    </dxe:ASPxButton>

     

     

    but :  btn.Enabled = false;

    is not correct, please give me the correct syntaxe.thanks Yes

     

    </script>

     

  • Brendon Muck [DX Squad]

    Re: change attributes for the server controls with javascript

    8/25/2008 12:31 PM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 5,816

    Try using:

    btn.Disabled = true;

    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Andy Tr (DevExpress)

    Re: change attributes for the server controls with javascript

    8/26/2008 3:53 AM
    • Top 50 Contributor
    • Joined on 5/7/2007
    • Posts 688

    Hello,

    To be quite correct, it's better to take a look at the member list of the ASPxClientButton object within our help file. There, you can find information about all available client members of a button control. Among them, there is a SetEnabled method, which we recommend to use to change button availability to end-users on the client.

    Thanks,
    R&D, ASP.NET Team, DevExpress
    Andrew

    P.S. This is a peer-to-peer forum. For technical support, contact our Support Team directly at http://www.devexpress.com/Support/Center/ to get a guaranteed reply within a business day.
    Filed under: ,
  • hankach abdelaziz

    Re: change attributes for the server controls with javascript

    8/26/2008 7:18 AM
    • Not Ranked
    • Joined on 8/22/2008
    • Posts 10

     thank you very much Mr Andrew, your answer was very interessting

    and thanks also for Mr Brendon.

  • Alexander Yaremchuk

    Re: change attributes for the server controls with javascript

    11/20/2008 5:24 AM
    • Not Ranked
    • Joined on 11/20/2008
    • Posts 16

    Hi Andrew!

     

    Have some strange things using ASPxClientButton.

    My Code is :

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} <dxe:ASPxButton EnableClientSideAPI="true" ID="btnEmail" ClientInstanceName="btnEmailClient" runat="server" Text="Email" onclick="btnEmail_Click">
    </dxe:ASPxButton>

    then in JS handler I call "btnEmailClient.Enabled = (gridDocs.GetSelectedRowCount() > 0" (I know it is possible to us SetEnabled now).

    When executed it tells that  btnEmailClient is not defined.

    When I view html page source I see that it is actually not.

    (gridDocs - which also uses ClientInstanceName="gridDocs" is there  and works.

    like - "var dxo = new ASPxClientGridView('ctl00_cphBody_ctrlQuoteDocs_gridDocs');")

    What's with it ?

    When I did web search for ASPxClientButton but it didn't found much and nothing in DX help.

     

    Hope on your reply.

  • Alexander Yaremchuk

    Re: change attributes for the server controls with javascript

    11/21/2008 2:25 AM
    • Not Ranked
    • Joined on 11/20/2008
    • Posts 16

    Hello All!

    I want to report that I found way to resolve problem that I described in the previous message.

    It resolved by readding buttons to the form, but before I checked out for edit files licenses.licx and App_Licenses.dll.

    The matter is we have exclusive lock in our CVS (TFS) and when one man edits file another one can't change it.

    So as this files are changed frequently it is constantly locked - everything works good beyond client API.

    Think it is the matter.

     

    Thank you, hope that it may help someone else!

     

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.