Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 ?

share|improve this question
    
Can you please share your PageLoad event code...? –  Arsalan Adam Khatri Dec 12 '12 at 18:48

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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