c# - link button click event not working -


I am working on a project where I am creating a dynamic table. Now on the basis of my status, I am adding cells to the table, but the occurrence of clicking on my link button is not working. I can not find why he is not doing the work, and not seeing any error. The following is my code

  Public Zero MailCalendar () {tblcalendar.Rows.Clear (); // Start date time for current month = Start ImportoffMonth (Datetime.new Adams (no monthsclose)); DateTimeEnd = EndDateMonth (Datetime.now Automomoths (not Monthly)); Start String = Getting Started Dioufvik Toasting (); Int startdayno = Convert toInt32 (startdate.DayOfWeek); String and Day = Enddate. Diap wake Toasting (); // like Saturday is 6, with Monday on 1, and ends, 7 in xdaydays = Sunday with convert To INT 32 (Ended Dieoff Week); // Date expiration date for preview month = (expiration date) (date time.Nobeddomains (not monthly)); // DateTime startdatenext = StartDateOfMonth (DateTime.Now.AddMonths (1)) for next month; Datetime dtstart = start. Ed. (- (start day + 1)); // sMonthName = "Jan"; // Int iMonthNo = Convert ToDateTime ("01-" + sMonthName + "-2011") Month; For (int i = 0; i <7; i ++) {tabler tr = new tabler (); For (int j = 0; j and lt; 7; j ++) {tableclass tc = new tablecase (); Clickable ctCell = new clickable (); //tc.ID = idtc.ToString (); idtc ++; If (i == 0) {tr.CssClass = "firstrow"; Tc.CssClass = "FirstSoose"; If (j == 0) tc.text = "Sun"; Else if (j == 1) tc.text = "Mon"; Else if (j == 2) tc.text = "tue"; Else if (j == 3) tc.text = "Mercury"; Else if (j == 4) tc.text = "thu"; Else if (j == 5) tc.text = "Fri"; Else if (j == 6) tc.text = "sat"; Tr.Cells.Add (TC); } Other {tc.CssClass = "other seals"; Dtstart = dtstart.AddDays (1); // if the date is a digit such as 1,2 if (dtstart.ToString ("dd"). Substrings (0, (dtstart.ToString ("dd"). Length) -1) == "0") ctCell.Text = (Dtstart.ToString ("dd"). Substring (1)); Else ctCell.Text = (dtstart.ToString ("dd")); CtCell.Attributes.Add ("onmouseover", "defColor = this.style.backgroundColor; this.style.backgroundColor = 'LightGray';"); CtCell.Attributes.Add ("OnSiteout", "this.style.backgroundColor = defColor;"); //ctCell.ID = K.Testring (); K ++; CtCell.Click + = New clickablecell.ClickEventHandler (textcell_Click); // Check the event at this date datatelle dtevents = checkEvents (dtstart.ToString ("dd-MM-yyyy")); If (dtevents.Rows.Count! = 0) {LinkButton lnkevent = new LinkButton (); //lnkevent.ClientIDMode = "static"; Lnkevent.ID = (i + j) .restring (); If (dtevents.Rows.Count == 1) {if (dtevents.rows [0] ["eventtype"] ToString () == "Holiday") {lnkevent.Text = dtevents.Rows [0] ["eventtype"] .Wire(); Lnkevent.CssClass = "tcholidaytext"; CtCell.CssClass = "tcholidaytext"; } And if (dtevents.rows [0] ["eventtype"]. ToString () == "Event") {lnkevent.Text = dtevents.Rows [0] ["eventtype"]. ToString (); Lnkevent.CssClass = "tceventtext"; CtCell.CssClass = "tceventtext"; } And {lnkevent.Text = dtevents.Rows [0] ["Event Image"]. ToString (); Lnkevent.CssClass = "tcimpdaytext"; CtCell.CssClass = "tcimpdaytext"; }} Else {ctCell.CssClass = "tcmixtext"; } //lnkevent.Attributes.Add ("click on", "test ();"); //lnkevent.click + = lnkevent_OnClick; Lnkevent.Click + = new event handler (lnkevent_OnClick); ctCell.Controls.Add (lnkevent); } Tr.Cells.Add (ctCell); } Add Tblcalendar.Rows.Add (tr); }}} Public Zero lnkevent_OnClick (Object Sender, EventArgs e) {lblmonthname.Text = "hellooo"; Txttitle.Text = ""; }    

Looks like you're adding a button, but binding to an event listener is not . I do not know much about how to bind Asp.Net, but it seems that your problem may be.

Maybe this link can help?



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -