Hi,
I am trying to change label text on button click, the way label.text = "string" work well before but not in this case.
I tried to put this on other method and it work..it is just not working on the button that I would like to fire..
Can anybody help?? I stuck in this problem for fews day..and cant get any useful information from google..
C# code :
[code]protected void btnTotalGroupMember_Click(object sender, EventArgs e)
{
string s = "there";
string[] words = s.Split(' ');
foreach (string word in words)
{
Label1.Text = s;
}
SqlConnection con;
String conStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
con = new SqlConnection(conStr);
con.Open();
string selectMemberQuery = "SELECT userID from [group]";
SqlCommand cmd = new SqlCommand(selectMemberQuery, con);
SqlDataReader rd = cmd.ExecuteReader();
if (rd.HasRows)
{
rd.Read();
string UID = rd["userID"].ToString();
string[] cUIDs = UID.Split(',');
foreach (string cUID in cUIDs)
{
string sqlQuery2 = "SELECT m.username,m.email from member m,group g where m.userID = " + cUID;
SqlCommand cmd2 = new SqlCommand(sqlQuery2, con);
SqlDataReader rd2 = cmd2.ExecuteReader();
/* if (rd2.HasRows)
{
rd2.Read();
Table tbl = new Table();
tbl.ID = "tblUser";
this.Controls.Add(tbl);
TableRow rw = new TableRow();
TableCell cell = new TableCell();
TableCell cell2 = new TableCell();
Label text = new Label();
Label text2 = new Label();
Label1.Text = rd2["username"].ToString();
Label2.Text = rd2["email"].ToString();
cell.Controls.Add(text);
cell2.Controls.Add(text2);
rw.Cells.Add(cell);
rw.Cells.Add(cell2);
tbl.Controls.Add(rw);
}*/
}
}
con.Close();
}[/code]
Web Form ( button)
[code][/code]
Web Form (addEventInterface2) -> Java script function
[code]function addEventInterface2() {
document.getElementById('overlayLayer2').style.paddingTop = "50%";
document.getElementById('overlayLayer2').style.visibility = "visible";
document.getElementById('overlayLayer2').className = "ui-widget-overlay";
document.getElementById('shadow2').className = "ui-widget-shadow ui-corner-all";
document.getElementById('shadow2').style.visibility = "visible";
document.getElementById('hi3').className = "ui-widget ui-widget-content ui-corner-all";
document.getElementById('hi3').style.visibility = "visible";
document.getElementById('addEventIntContent2').className = "ui-dialog-content ui-widget-content";
document.getElementById('addEventIntContent2').style.visibility = "visible";
document.getElementById('draggableInt2').style.visibility = "visible";
return false;
}[/code]
Web form ( the location of label text that I would like to change)
[code]
[/code]