<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Unable to change label text for certain location on web form (Label.te' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Unable to change label text for certain location on web form (Label.te' posted on the 'C#' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Thu, 20 Jun 2013 02:03:28 -0700</pubDate>
    <lastBuildDate>Thu, 20 Jun 2013 02:03:28 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Unable to change label text for certain location on web form (Label.te</title>
      <link>http://www.programmersheaven.com/mb/csharp/430554/430554/unable-to-change-label-text-for-certain-location-on-web-form-labelte/</link>
      <description>Hi, &lt;br /&gt;
&lt;br /&gt;
I am trying to change label text on button click, the way label.text = "string" work well before but not in this case.&lt;br /&gt;
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.. &lt;br /&gt;
&lt;br /&gt;
Can anybody help?? I stuck in this problem for fews day..and cant get any useful information from google..&lt;br /&gt;
&lt;br /&gt;
C# code :&lt;br /&gt;
&lt;pre class="sourcecode"&gt;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["Connection
String"].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();

}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Web Form ( button)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;asp:Button ID="btnTotalGroupMember" runat="server" 
BorderStyle="None" Font-Size="12px" ForeColor="#A29881" BackColor="White" 
OnClientClick="return addEventInterface2();" 
onclick="btnTotalGroupMember_Click"/&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Web Form (addEventInterface2) -&amp;gt; Java script function&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;function addEventInterface2() {
document.getElementById('overlayLayer2').style.pad
dingTop = "50%";
document.getElementById('overlayLayer2').style.vis
ibility = "visible";
document.getElementById('overlayLayer2').className = "ui-widget-overlay";
document.getElementById('shadow2').className = "ui-widget-shadow ui-corner-all";
document.getElementById('shadow2').style.visibilit
y = "visible";
document.getElementById('hi3').className = "ui-widget ui-widget-content ui-corner-all";
document.getElementById('hi3').style.visibility = "visible";
document.getElementById('addEventIntContent2').cla
ssName = "ui-dialog-content ui-widget-content";
document.getElementById('addEventIntContent2').sty
le.visibility = "visible";
document.getElementById('draggableInt2').style.vis
ibility = "visible";
return false;
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Web form ( the location of label text that I would like to change)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;div id="overlayLayer2" style="height: 1%; visibility: hidden;"&amp;gt; 
&amp;lt;/div&amp;gt;
&amp;lt;div id="draggableInt2" style="width: 50%; height: 65%; position: absolute; left: 32%; top: 20%;
visibility: hidden;"&amp;gt;
&amp;lt;div id="shadow2" style="width: 100%; height: 100%; position: absolute; left: 0.5%;
top: 0.5%; visibility: hidden;"&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div id="hi3" style="position: absolute; width: 97%; height: 97%; left: 1.5%; top: 1.5%;
visibility: hidden;"&amp;gt;
&amp;lt;div id="addEventIntContent2" style="background: none; border: 0; visibility: hidden;"&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;div style="float: right"&amp;gt;
&amp;lt;asp:ImageButton ID="btnCloseEventInt2" runat="server" ImageUrl="~/image/btnCloseEventInt.png"
OnClientClick="return endEventInterface2()" /&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt;
&amp;lt;asp:Label ID="Label1" runat="server" &amp;gt;&amp;lt;/asp:Label&amp;gt;
&amp;lt;asp:Label ID="Label2" runat="server" &amp;gt;&amp;lt;/asp:Label&amp;gt;
&amp;lt;/div&amp;gt; 
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/csharp/430554/430554/unable-to-change-label-text-for-certain-location-on-web-form-labelte/</guid>
      <pubDate>Fri, 07 Dec 2012 02:05:16 -0700</pubDate>
      <category>C#</category>
    </item>
  </channel>
</rss>