Showing posts with label formview. Show all posts
Showing posts with label formview. Show all posts

Saturday, March 24, 2012

Problem displaying Label in UpdatePanel

I'm having a problem displaying a Label control in a FormView which is within an UpdatePanel. The Label displays fine if the FormView is moved out of the UpdatePanel.

I'm getting the error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

I don't have any Response.Writes.

I see that quite a lot of people are experiencing the same error but so far none for exactly the
same reason as me.

Hi,

please check ifthis post helps.

Wednesday, March 21, 2012

problem of find control in nested Formview control

I can find my Textbox contols in following structures,

<asp:PanelID="Popup1"runat="server"CssClass="popup"style="display:none;">

<asp:UpdateProgressid="UpdateMessagesProgress"DynamicLayout="false"runat="server"DisplayAfter="0">

<ProgressTemplate>

Processing...

</ProgressTemplate>

</asp:UpdateProgress>

<asp:UpdatePanelID="UpdatePopup"runat="server"UpdateMode=Always>

<ContentTemplate>

<asp:FormViewid="FormView1"runat="server" DefaultMode="Edit">

<EditItemTemplate>

<asp:TextBoxid="title_TextBox"runat="server" Text='<%# Bind("title") %>'></asp:TextBox>

............

</EditItemTemplate>

</asp:FormView>

</ContentTemplate>

</asp:UpdatePanel>

</asp:Panel>

I want to set the textbox's visible to false but can't find it. Please help me!!

Check out

http://forums.asp.net/t/1107107.aspx it may help you


Try this one :

FormView1.FindControl('title_TextBox').Visible = false


I still can't solve this problem. Any other ideas?


Finally, I can find my Textbox control by using following method:

In RowUpdating envent:

protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow MyRow = GridView2.Rows[e.RowIndex];

if (MyRow != null)
{
TextBox exit_price_text = MyRow .FindControl("exit_price_TextBox") as TextBox;
.....

}

}