Click here to Skip to main content
15,905,682 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How no to direct to a page aftr logging out ? Pin
Karthick_gc16-Feb-09 1:23
Karthick_gc16-Feb-09 1:23 
GeneralRe: How no to direct to a page aftr logging out ? Pin
rakeshs31216-Feb-09 1:35
rakeshs31216-Feb-09 1:35 
GeneralRe: How no to direct to a page aftr logging out ? Pin
Karthick_gc16-Feb-09 1:41
Karthick_gc16-Feb-09 1:41 
QuestionFrame? Pin
Karthick_gc15-Feb-09 23:28
Karthick_gc15-Feb-09 23:28 
AnswerRe: Frame? Pin
Gaurav K Singh16-Feb-09 0:48
Gaurav K Singh16-Feb-09 0:48 
QuestionXML navigation Pin
Member 398136615-Feb-09 23:15
Member 398136615-Feb-09 23:15 
AnswerRe: XML navigation Pin
SeMartens16-Feb-09 2:42
SeMartens16-Feb-09 2:42 
Questionscroll posititon for div but different problem (timer is there) Pin
rahul_miche15-Feb-09 23:01
rahul_miche15-Feb-09 23:01 
I have developed a chat application.

i am displaying chat messages using gridview in a div.I am using gridview in update panel(ajax).With every timer_tick I update the gridview.My timer control s in control template of update panel.The problem is I have to maintain the scroll position after after timer tick event ie after the grid gets the data.

I ahve altried all the options on the net.None of them is working.Help me Its urgent.
This problem is buggin me alot.


Here is the code .aspx

]]>





<title>Welcome to chat application
<%----%>





<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">


<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>



<asp:gridview showheader="false" width="1%" cellpadding="0" cellspacing="0" id="gvmsg" gridlines="None" runat="Server" autogeneratecolumns="false">
<columns> <asp:templatefield>
<itemtemplate>

]]>
<%-- <asp:label id="lblchtmsg" width="230px" runat="server" text="<%#Eval(" chat_msgs")%&gt;"=""> --%>
<%#Eval("Chat_msgs")%>



<rowstyle backcolor="WhiteSmoke">
<alternatingrowstyle backcolor="#E0E0E0">






<asp:timer id="Timer1" runat="server" interval="200" ontick="Timer1_Tick" enabled="True">

<%--<asp:timer id="Timer2" runat="server" ontick="Timer2_Tick" enabled="False" interval="200">

--%>












here is the .cs code

public partial class showmsg : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{



}
public void asUser()
{
string cnt = dbFunctions.getSingleRecord ("select count(*) from ChatMsgs where Chat_id='" + Session["chatid"].ToString()+"'");
if (int.Parse(cnt) > 10)
lbtncomplete.Visible = true;
// DataTable dt = dbFunctions.getTable("select * from ChatMsgs where Chat_id='" + Session["chatid"].ToString() + "' ORDER BY ID ASC");
DataTable dt = dbFunctions.getTable("select * from ChatMsgs where ID in(select TOP 11 ID from ChatMsgs where Chat_id='" + Session["chatid"].ToString() + "' ORDER BY ID DESC) ");
gvmsg.DataSource = dt;
gvmsg.DataBind();

}
public void asAdmin()
{
DataTable dt = dbFunctions.getTable("select * from ChatMsgs where Chat_id='" + Session["chatid"].ToString() + "'");
// DataTable dt = dbFunctions.getTable("select * from ChatMsgs ORDER BY ID DESC ");
gvmsg.DataSource = dt;
gvmsg.DataBind();

}

protected void Timer1_Tick(object sender, EventArgs e)
{

//if (Session["top10"].ToString() == "true")
//asUser();
asAdmin();

}
protected void lbtncomplete_Click(object sender, EventArgs e)
{

//Session["top10"] = "false";
DataTable dt = dbFunctions.getTable("select * from ChatMsgs where Chat_id='" + Session["chatid"].ToString() + "' ORDER BY ID ASC");
// DataTable dt = dbFunctions.getTable("select * from ChatMsgs ORDER BY ID DESC ");
gvmsg.DataSource = dt;
gvmsg.DataBind();

}
}

Please help its really urgent


Thanks in advance
AnswerRe: scroll posititon for div but different problem (timer is there) Pin
Gaurav K Singh16-Feb-09 3:28
Gaurav K Singh16-Feb-09 3:28 
GeneralRe: scroll posititon for div but different problem (timer is there) Pin
rahul_miche16-Feb-09 23:18
rahul_miche16-Feb-09 23:18 
GeneralRe: scroll posititon for div but different problem (timer is there) Pin
Gaurav K Singh16-Feb-09 23:23
Gaurav K Singh16-Feb-09 23:23 
GeneralRe: scroll posititon for div but different problem (timer is there) Pin
rahul_miche16-Feb-09 23:42
rahul_miche16-Feb-09 23:42 
GeneralRe: scroll posititon for div but different problem (timer is there) Pin
rahul_miche17-Feb-09 0:10
rahul_miche17-Feb-09 0:10 
QuestionUpdate the table based on selected gridview row Pin
Shanthi Diana15-Feb-09 22:40
Shanthi Diana15-Feb-09 22:40 
AnswerRe: Update the table based on selected gridview row Pin
keyur satyadev15-Feb-09 23:16
keyur satyadev15-Feb-09 23:16 
QuestionHow to access the contain of master page in our cs file? Pin
keyur satyadev15-Feb-09 22:29
keyur satyadev15-Feb-09 22:29 
AnswerRe: How to access the contain of master page in our cs file? Pin
butchzn15-Feb-09 22:51
butchzn15-Feb-09 22:51 
GeneralRe: How to access the contain of master page in our cs file? Pin
keyur satyadev15-Feb-09 23:17
keyur satyadev15-Feb-09 23:17 
GeneralRe: How to access the contain of master page in our cs file? Pin
raju melveetilpurayil16-Feb-09 0:32
professionalraju melveetilpurayil16-Feb-09 0:32 
Questionms outlook 2003 + address list + windows application Pin
bhavna432115-Feb-09 21:43
bhavna432115-Feb-09 21:43 
QuestionNullReferenceException in UserControl in GridView Pin
sdas00715-Feb-09 21:42
sdas00715-Feb-09 21:42 
AnswerRe: NullReferenceException in UserControl in GridView Pin
Calin Tatar15-Feb-09 23:55
Calin Tatar15-Feb-09 23:55 
GeneralRe: NullReferenceException in UserControl in GridView Pin
sdas00717-Feb-09 19:06
sdas00717-Feb-09 19:06 
QuestionEntering javascript blocks into TextBox Pin
AndyBrew7015-Feb-09 21:17
AndyBrew7015-Feb-09 21:17 
AnswerRe: Entering javascript blocks into TextBox Pin
AndyBrew7015-Feb-09 21:33
AndyBrew7015-Feb-09 21:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.