Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Repeater in update panel

Repeater in update panel

Scheduled Pinned Locked Moved ASP.NET
databasequestionhelpannouncementcareer
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shahdat Hosain
    wrote on last edited by
    #1

    I want to develop status update like facbook's status update. To do this job I use following technique. I placed a repeater, textbox and button into a updatepanel. Repeater contain a label to show all status from DB. When a user click on the button, the text will save on DB. And all status( including new) will be shown automatically by repeater after updating database. Here is my problem: After first clicking text is saved on DB. But page doesn't update with new status. After second click page update with the new status. Have any problem in my concept? If yes. Plz inform me how can I update the repeater automatically after DB updating .

    shahdat

    A 1 Reply Last reply
    0
    • S Shahdat Hosain

      I want to develop status update like facbook's status update. To do this job I use following technique. I placed a repeater, textbox and button into a updatepanel. Repeater contain a label to show all status from DB. When a user click on the button, the text will save on DB. And all status( including new) will be shown automatically by repeater after updating database. Here is my problem: After first clicking text is saved on DB. But page doesn't update with new status. After second click page update with the new status. Have any problem in my concept? If yes. Plz inform me how can I update the repeater automatically after DB updating .

      shahdat

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      When you are loading data in Repeater Control ? I guess there is problem related with PostBack.

      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

      S 1 Reply Last reply
      0
      • A Abhijit Jana

        When you are loading data in Repeater Control ? I guess there is problem related with PostBack.

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

        S Offline
        S Offline
        Shahdat Hosain
        wrote on last edited by
        #3

        I seems as you. Plz verify my c# code

        protected void Page_Load(object sender, EventArgs e)
        { ShowAlerts(_alertService.GetStatusAlertsByAccountID(_userSession.CurrentUser.AccountID));
        }

        public void ShowAlerts(List<Alert> Statusalerts)
        {
        repStatus.DataSource = Statusalerts;
        repStatus.DataBind();
        if (repStatus.Items.Count == 0)
        lblStatusMessage.Text = "You don't have any status alerts yet!";

        }

            protected void btnShare\_Click(object sender, ImageClickEventArgs e)
            {
                
                StatusUpdate su = new StatusUpdate(); // Statusupdate table
                su.Status = msgText;
                \_alertService.AddStatusUpdateAlert(su);
                 }                     
                txtStatusUpdate.Text = "";            
            }
        

        plz help me.

        shahdat

        A 1 Reply Last reply
        0
        • S Shahdat Hosain

          I seems as you. Plz verify my c# code

          protected void Page_Load(object sender, EventArgs e)
          { ShowAlerts(_alertService.GetStatusAlertsByAccountID(_userSession.CurrentUser.AccountID));
          }

          public void ShowAlerts(List<Alert> Statusalerts)
          {
          repStatus.DataSource = Statusalerts;
          repStatus.DataBind();
          if (repStatus.Items.Count == 0)
          lblStatusMessage.Text = "You don't have any status alerts yet!";

          }

              protected void btnShare\_Click(object sender, ImageClickEventArgs e)
              {
                  
                  StatusUpdate su = new StatusUpdate(); // Statusupdate table
                  su.Status = msgText;
                  \_alertService.AddStatusUpdateAlert(su);
                   }                     
                  txtStatusUpdate.Text = "";            
              }
          

          plz help me.

          shahdat

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          MD. SHAHDAT HOSAIN wrote:

          protected void Page_Load(object sender, EventArgs e) { ShowAlerts(_alertService.GetStatusAlertsByAccountID(_userSession.CurrentUser.AccountID)); }

          Try this following,

          protected void Page_Load(object sender, EventArgs e)
          {
          if(!Page.IsPostBack)
          {
          ShowAlerts(_alertService.GetStatusAlertsByAccountID(_userSession.CurrentUser.AccountID));
          }
          }

          And Call the ShowAlert Method After the Table, means on Share Button Click.

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

          S 1 Reply Last reply
          0
          • A Abhijit Jana

            MD. SHAHDAT HOSAIN wrote:

            protected void Page_Load(object sender, EventArgs e) { ShowAlerts(_alertService.GetStatusAlertsByAccountID(_userSession.CurrentUser.AccountID)); }

            Try this following,

            protected void Page_Load(object sender, EventArgs e)
            {
            if(!Page.IsPostBack)
            {
            ShowAlerts(_alertService.GetStatusAlertsByAccountID(_userSession.CurrentUser.AccountID));
            }
            }

            And Call the ShowAlert Method After the Table, means on Share Button Click.

            Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

            S Offline
            S Offline
            Shahdat Hosain
            wrote on last edited by
            #5

            Thanks Im successful on behalf of your suggestion. But a little problem show yet. if more than one status post within 60 seconds then later post print under the previous one. Is it a mater of timer or anything else. Plz suggest me.

            shahdat

            A 1 Reply Last reply
            0
            • S Shahdat Hosain

              Thanks Im successful on behalf of your suggestion. But a little problem show yet. if more than one status post within 60 seconds then later post print under the previous one. Is it a mater of timer or anything else. Plz suggest me.

              shahdat

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              MD. SHAHDAT HOSAIN wrote:

              But a little problem show yet. if more than one status post within 60 seconds then later post print under the previous one.

              I didn't get your point. Sorry :confused: Can you please explain me in little details . Hope I may help you :)

              Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups