Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hiding and showing controls from the Client side
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Hiding and showing controls from the Client side
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01306938
Message ID:
01306938
Views:
45
Hi everybody,

My mind is still going back to the problem I was trying to solve couple of days ago.

I have a grid view on the form. When I press Edit button from this grid, I hide the grid (in server-side code) and then show information in the table where I have 2 buttons Save and Cancel.

Here is some relevant info in the Edit code:
this.drpSelRole.Visible = false;
        this.grdvwUsers.Visible = false;
        this.tblProInfo.Visible = true;
This is from the Save button's code:
 this.lblProfStat.Text = "Profile Saved";
        this.lblProfStat.Visible = true;
        this.drpSelRole.Visible = true;
        this.grdvwUsers.Visible = true;
        this.tblProInfo.Visible = false;
Putting similar code in the Cancel button also works fine.

However, it sounds like such a waste to do it on the server-side.

Here are my attempts to do it Client-side:
protected void Page_Init(object sender, EventArgs e)
    {
        //this.btnCancelProfile.Attributes["onclick"] = "HideElement('" + this.tblProInfo.ClientID + "');" ;
        this.btnCancelProfile.Attributes["onclick"] = "ToggleDisplay('true','GridInfo','" +
            this.drpSelRole.ClientID + "','" + this.grdvwUsers.ClientID +
            "');ToggleDisplay('false','ProfileInfo');return false;";        
        

        this.btnAddToRole.Attributes["onclick"] = "return CheckSelected('" + this.lsbUsers.ClientID +
                                                 "','Please select Users') && CheckSelected('" +
                                                 this.LsbRoles.ClientID + "','Please select Roles');";
Unfortunately, only "hiding" part works for this button and the grid and combobox never re-displayed.

Do you know what may be wrong and why I can not make them re-appear using Client-side code?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform