Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Unable to change label text for certain location on web form (Label.te

hkw_9105hkw_9105 Member Posts: 1

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 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);


string selectMemberQuery = "SELECT userID from [group]";
SqlCommand cmd = new SqlCommand(selectMemberQuery, con);
SqlDataReader rd = cmd.ExecuteReader();

if (rd.HasRows)

string UID = rd["userID"].ToString();
string[] cUIDs = UID.Split(',');
foreach (string cUID in cUIDs)
string sqlQuery2 = "SELECT m.username, from member m,group g where m.userID = " + cUID;
SqlCommand cmd2 = new SqlCommand(sqlQuery2, con);
SqlDataReader rd2 = cmd2.ExecuteReader();

/* if (rd2.HasRows)

Table tbl = new Table();
tbl.ID = "tblUser";


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();







Web Form ( button)


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;

Web form ( the location of label text that I would like to change)


Sign In or Register to comment.