Repeater in update panel
-
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
-
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
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.
-
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.
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
-
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
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.
-
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.
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
-
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
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.