1

I have developed a small application in SharePoint. I am using custom application page and load .ascx Control over that page under Page_Load() method. In .ascx Control, I have created a small form with text boxes and a button Control. under this button click event, I want to change the text property of label like: lblConfirmation.Text = "Confirmation is OK"; but it did not change the text. It shows nothing because i set text property empty in label Control.

<asp:Label ID="lblConfirmation" runat="server" Text="" ></asp:Label>

Any Idea, what is wrong ?

  • Can you please share your PageLoad event code...? – Arsalan Adam Khatri Dec 12 '12 at 18:48
1

Probably you need to check if it's a real postback or a first page load in your Page_Load() method... like this

if(!IsPostback)
{
    // code to only run at first page load here 
}

Otherwise you will initiate the label.Text to an empty string on each postback of the page and the page will be (more or less) static.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.