TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul sharma
NA
456
2.1k
I using repeater in Masterpage How I can Activate Item_Command Event of Repeater
Feb 14 2012 8:21 AM
protected void chatrepeter_ItemCommand(object source, RepeaterCommandEventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["LinqChatConnectionString"].ToString());
if (e.CommandName == "Click")
{
string linkUpid = e.CommandArgument.ToString();
//Response.Redirect("ChatRoom.aspx");
Session["ChatUserID"] = userId;
Session["ChatUsername"] = Username;
string s = Session["UPID"].ToString() + "-" + linkUpid;
int a = CheckExistance(s);
if (a > 0)
{
con.Open();
SqlCommand cmd = new SqlCommand("update LoggedInUser set chatid='" + s + "' WHERE upid='" + Session["UPID"].ToString() + "' and upid='" + linkUpid + "'", con);
cmd.ExecuteNonQuery();
con.Close();
string myroom = myroomiD(s);
// Response.Redirect("Chatroom.aspx?roomId=" + myroom + "&ReqChatID=" + s + "");
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID, "window.open('Chatroom.aspx?roomId=" + myroom + "&ReqChatID=" + s + "','width=800px','height=200px','scrollbars=1','menu=1','scroll=yes',null,'yes');", true);
}
else
{
con.Open();
SqlCommand cmd1 = new SqlCommand("insert into dbo.Room(Name) values('" + s + "')");
cmd1.ExecuteNonQuery();
cmd1.CommandText = "update LoggedInUser set chatid='" + s + "' WHERE upid='" + Session["UPID"].ToString() + "' or upid='" + linkUpid + "'";
cmd1.ExecuteNonQuery();
con.Close();
string myroom = myroomiD(s);
// Response.Redirect("Chatroom.aspx?roomId=" + myroom + "&ReqChatID=" + s + "");
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID, "window.open('Chatroom.aspx?roomId=" + myroom + "&ReqChatID=" + s + "','width=800px','height=200px','scrollbars=1','menu=1','scroll=yes',null,'yes');", true);
}
}
}
Pop-up Cannot Open
Reply
Answers (
0
)
How do I redirect page in MVC3?
Message's to be send from Asp.net Web Application to Mobile