Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing visibility of the control in RowDelete method
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
AJAX
Title:
Changing visibility of the control in RowDelete method
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01317077
Message ID:
01317077
Views:
53
Hi everybody,

On my page I tried to add UpdatePanel in order to make smooth page refreshes.

Here is some code (this control is on the top of the page)
<div id="round">
<div id="roundedStat" style="height: auto; width: auto;" runat="server">
<table style="font-weight: bolder; vertical-align: middle; color: #FFFFFF; width: 20%; text-align: center;" cellpadding="0" cellspacing="0">
<tr>
	<td><img alt="" src="../../images/tl-LightBlue.gif" height="10" width="10" /></td>
	<td style="background-color: #5BA2EB;"> </td>
	<td><img alt="" src="../../images/tr-LightBlue.gif" height="10" width="10" /></td>
</tr>
<tr style="background-color: #5BA2EB;">
	<td> </td>
	<td>
	<asp:Label ID="lblStatus" Style="display: inline; white-space: nowrap;" runat="server"></asp:Label>
	    <asp:LinkButton ID="UndoDel" runat="server" CausesValidation="False" 
            CommandName="Undelete" OnCommand ="UndoDel_Command" Visible="False">Undo</asp:LinkButton>
	<asp:PlaceHolder ID="plchStatusControls" runat="server" EnableViewState="False"></asp:PlaceHolder>
	</td>
	<td> </td>
</tr>
<tr>
	<td><img alt="" src="../../images/bl-LightBlue.gif" height="10" width="10" /></td>
	<td style="background-color: #5BA2EB; height: 10px;"> </td>
	<td><img alt="" src="../../images/br-LightBlue.gif" height="10" width="10" /></td>
</tr>
</table>
</div>
</div>     
The above is the PlaceHolder for important messages.

Now, I have a GridView bellow inside the update panel
<asp:UpdatePanel ID = "updGrid" runat = "server">   
                      <ContentTemplate>  
                      
                        <asp:GridView runat="server" ID="ProfilesGrid" 
					
....
</asp:GridView>
						</ContentTemplate>
						
						    <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ddlApprovedStatus" 
                                    EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="search_go" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="bntSavedApproved" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="ddlApprovedStatus" EventName="SelectedIndexChanged" />
                                <asp:AsyncPostBackTrigger ControlID="search_go" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                                <asp:AsyncPostBackTrigger ControlID="bntSavedApproved" EventName="Click" />
                            </Triggers>						
						</asp:UpdatePanel>
Now when I delete a record from the grid I have the following code:
protected void ProfilesGrid_RowDeleted(object sender, GridViewDeletedEventArgs e)
    {
        if (e.Exception == null)   
        {
            this.roundedStat.Style["display"] = "block";
            this.lblStatus.Text = "Removed " + e.Values["FirstName"] + " " + e.Values["LastName"] + " click to ";
            LinkButton UndoDel = (LinkButton)this.plchStatusControls.FindControl("UndoDel") ;
            if (UndoDel != null)
            {
                UndoDel.Visible = true;
                UndoDel.Text = "Undo";
                UndoDel.CommandName = "Undelete";
                UndoDel.CausesValidation = false;
                UndoDel.CommandArgument = e.Keys["RegistrationID"].ToString();
            }
            this.DeletedID = (int)e.Keys["RegistrationID"];
           // UndoDel.Command += new CommandEventHandler(UndoDel_Command); // This doesn't really work
            //this.plchStatusControls.Controls.Add(UndoDel);
            this.ClientScript.RegisterStartupScript(this.GetType(), "HighlightMess", " Effect.Pulsate('round',1,0.7);", true);
        }
    }
And it worked before, but now I don't see the Rounded Style at all and when I debug it I see that InnerHTML throws an exception (though it's not shown in IE7)...

Is there any graceful way to solve the problem without removing UpdatePanel (I like it) ?

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


My Blog
Reply
Map
View

Click here to load this message in the networking platform