3 // Rafael Mizrahi <rafim@mainsoft.com>
4 // Erez Lotan <erezl@mainsoft.com>
5 // Vladimir Krasnov <vladimirk@mainsoft.com>
8 // Copyright (c) 2002-2005 Mainsoft Corporation.
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System.Web.UI.WebControls;
34 using System.Web.UI.HtmlControls;
36 using System.Reflection;
37 using System.Collections;
40 namespace GHTTests.System_Web_dll.System_Web_UI
42 public class Control_ViewState
45 protected System.Web.UI.WebControls.Button Button1;
46 #region Web Form Designer generated code
47 override protected void OnInit(EventArgs e)
50 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
52 InitializeComponent();
57 /// Required method for Designer support - do not modify
58 /// the contents of this method with the code editor.
60 private void InitializeComponent()
62 this.Load += new System.EventHandler(this.Page_Load);
67 // =======================
69 // =======================
70 // In order to catch these values the dynamically generated controls
71 // needs to be re-generated at Page_Load.
72 // The important thing is to assign the same ID to each control.
73 // The ViewState uses the ID property of the Control objects to reinstate the values.
75 // =======================
77 // =======================
78 // We set the contrro//s tested member with a value
79 // only at the first time the page is loaded
82 private void Page_Load(object sender, EventArgs e)
84 HtmlForm form1 = (HtmlForm) (HtmlForm)this.FindControl("Form1");
85 this.GHTTestBegin(form1);
86 this.GHTSubTestBegin("Check PostBack");
89 if (this.Page.IsPostBack)
91 this.GHTSubTestAddResult("PostBack Worked!!!");
94 catch (Exception exception49)
96 // ProjectData.SetProjectError(exception49);
97 Exception exception1 = exception49;
98 this.GHTSubTestAddResult("Unxpected " + exception1.GetType().Name + " exception was caught-" + exception1.Message);
99 // ProjectData.ClearProjectError();
101 this.GHTSubTestEnd();
102 this.GHTSubTestBegin("AdRotator.KeywordFilter,Target");
105 AdRotator rotator1 = new AdRotator();
106 rotator1.ID = "objAdRotatorAll";
107 base.GHTActiveForm.Controls.Add(rotator1);
108 if (!this.Page.IsPostBack)
110 rotator1.KeywordFilter = "test";
111 rotator1.Target = "_blank";
115 this.GHTSubTestAddResult(rotator1.KeywordFilter);
116 this.GHTSubTestAddResult(rotator1.Target);
119 catch (Exception exception50)
121 // ProjectData.SetProjectError(exception50);
122 Exception exception2 = exception50;
123 this.GHTSubTestAddResult("Unxpected " + exception2.GetType().Name + " exception was caught-" + exception2.Message);
124 // ProjectData.ClearProjectError();
126 this.GHTSubTestEnd();
127 Label label1 = new Label();
128 this.GHTSubTestBegin("Style.BorderColor,BorderWidth,BorderStyle,CssClass,ForeColor,Height,Width,BackColor");
131 label1.ID = "objStyleLabelAll";
132 base.GHTActiveForm.Controls.Add(label1);
133 if (!this.Page.IsPostBack)
135 label1.Style["BorderColor"] = "ffffff";
136 label1.Style["ForeColor"] = "ffffff";
137 label1.Style["BackColor"] = "ffffff";
138 label1.Style["BorderWidth"] = "2";
139 label1.Style["BorderStyle"] = "3";
140 label1.Style["CssClass"] = "CssClass";
141 label1.Style["Height"] = "2";
142 label1.Style["Width"] = "2";
146 this.GHTSubTestAddResult(label1.Style["BorderColor"]);
147 this.GHTSubTestAddResult(label1.Style["ForeColor"]);
148 this.GHTSubTestAddResult(label1.Style["BackColor"]);
149 this.GHTSubTestAddResult(label1.Style["BorderWidth"]);
150 this.GHTSubTestAddResult(label1.Style["BorderStyle"]);
151 this.GHTSubTestAddResult(label1.Style["CssClass"]);
152 this.GHTSubTestAddResult(label1.Style["Height"]);
153 this.GHTSubTestAddResult(label1.Style["Width"]);
156 catch (Exception exception51)
158 // ProjectData.SetProjectError(exception51);
159 Exception exception3 = exception51;
160 this.GHTSubTestAddResult("Unxpected " + exception3.GetType().Name + " exception was caught-" + exception3.Message);
161 // ProjectData.ClearProjectError();
163 this.GHTSubTestEnd();
164 this.GHTSubTestBegin("FontInfo.Underline,Italic,Names,Overline,Size,Strikeout,Bold");
167 if (!this.Page.IsPostBack)
169 label1.Font.Underline = true;
170 label1.Font.Italic = true;
171 label1.Font.Names.SetValue("myfont", 1);
172 label1.Font.Overline = true;
173 label1.Font.Size = FontUnit.Medium;
174 label1.Font.Strikeout = true;
175 label1.Font.Bold = true;
179 this.GHTSubTestAddResult(label1.Font.Underline.ToString());
180 this.GHTSubTestAddResult(label1.Font.Italic.ToString());
181 this.GHTSubTestAddResult((string)(label1.Font.Names.GetValue(1)));
182 this.GHTSubTestAddResult(label1.Font.Overline.ToString());
183 this.GHTSubTestAddResult(label1.Font.Size.ToString());
184 this.GHTSubTestAddResult(label1.Font.Strikeout.ToString());
185 this.GHTSubTestAddResult(label1.Font.Bold.ToString());
188 catch (IndexOutOfRangeException exception52)
190 this.GHTSubTestAddResult("Test passed");
192 this.GHTSubTestEnd();
193 this.GHTSubTestBegin("Control.Visible");
196 Button button1 = new Button();
197 button1.ID = "objControlAll";
198 base.GHTActiveForm.Controls.Add(button1);
199 if (!this.Page.IsPostBack)
201 button1.Visible = false;
205 this.GHTSubTestAddResult(button1.Visible.ToString());
208 catch (Exception exception53)
210 // ProjectData.SetProjectError(exception53);
211 Exception exception5 = exception53;
212 this.GHTSubTestAddResult("Unxpected " + exception5.GetType().Name + " exception was caught-" + exception5.Message);
213 // ProjectData.ClearProjectError();
215 this.GHTSubTestEnd();
216 this.GHTSubTestBegin("WebControl.AccessKey,Enabled,TabIndex,ToolTip");
219 Button button2 = new Button();
220 button2.ID = "objWebControlAll";
221 base.GHTActiveForm.Controls.Add(button2);
222 if (!this.Page.IsPostBack)
224 button2.AccessKey = "F";
225 button2.Enabled = false;
226 button2.TabIndex = 100;
227 button2.ToolTip = "ToolTip";
231 this.GHTSubTestAddResult(button2.AccessKey);
232 this.GHTSubTestAddResult(button2.Enabled.ToString());
233 this.GHTSubTestAddResult(button2.TabIndex.ToString());
234 this.GHTSubTestAddResult(button2.ToolTip);
237 catch (Exception exception54)
239 // ProjectData.SetProjectError(exception54);
240 Exception exception6 = exception54;
241 this.GHTSubTestAddResult("Unxpected " + exception6.GetType().Name + " exception was caught-" + exception6.Message);
242 // ProjectData.ClearProjectError();
244 this.GHTSubTestEnd();
245 this.GHTSubTestBegin("Button.CausesValidation,CommandArgument,CommandName,Text");
248 Button button3 = new Button();
249 button3.ID = "objButtonAll";
250 base.GHTActiveForm.Controls.Add(button3);
251 if (!this.Page.IsPostBack)
253 button3.CausesValidation = true;
254 button3.CommandArgument = "test";
255 button3.CommandName = "test";
256 button3.Text = "test";
260 this.GHTSubTestAddResult(button3.CausesValidation.ToString());
261 this.GHTSubTestAddResult(button3.CommandArgument);
262 this.GHTSubTestAddResult(button3.CommandName);
263 this.GHTSubTestAddResult(button3.Text);
266 catch (Exception exception55)
268 // ProjectData.SetProjectError(exception55);
269 Exception exception7 = exception55;
270 this.GHTSubTestAddResult("Unxpected " + exception7.GetType().Name + " exception was caught-" + exception7.Message);
271 // ProjectData.ClearProjectError();
273 this.GHTSubTestEnd();
274 DataGrid grid1 = new DataGrid();
275 grid1.ID = "objDataGrid";
276 grid1.AutoGenerateColumns = false;
277 BoundColumn column1 = new BoundColumn();
278 column1.HeaderText = "IntegerValue";
279 column1.DataField = "IntegerValue";
280 grid1.Columns.Add(column1);
281 column1 = new BoundColumn();
282 column1.HeaderText = "StringValue";
283 column1.DataField = "StringValue";
284 grid1.Columns.Add(column1);
285 column1 = new BoundColumn();
286 column1.HeaderText = "CurrencyValue";
287 column1.DataField = "CurrencyValue";
288 grid1.Columns.Add(column1);
289 HyperLinkColumn column4 = new HyperLinkColumn();
290 column4.HeaderText = "objHyperLinkColumn";
291 grid1.Columns.Add(column4);
292 ButtonColumn column2 = new ButtonColumn();
293 column2.HeaderText = "ButtonColumn";
294 grid1.Columns.Add(column2);
295 EditCommandColumn column3 = new EditCommandColumn();
296 column3.HeaderText = "EditCommandColumn";
297 grid1.Columns.Add(column3);
298 grid1.DataSource = this.CreateDataSource();
300 base.GHTActiveForm.Controls.Add(grid1);
301 this.GHTSubTestBegin("BoundColumn.All");
304 column1 = (BoundColumn) grid1.Columns[2];
305 if (!this.Page.IsPostBack)
307 column1.DataFormatString = "{0:C}";
308 column1.ReadOnly = true;
309 column1.DataField = "IntegerValue";
313 this.GHTSubTestAddResult(column1.DataFormatString);
314 this.GHTSubTestAddResult(column1.ReadOnly.ToString());
315 this.GHTSubTestAddResult(column1.DataField);
318 catch (Exception exception56)
320 // ProjectData.SetProjectError(exception56);
321 Exception exception8 = exception56;
322 this.GHTSubTestAddResult("Unxpected " + exception8.GetType().Name + " exception was caught-" + exception8.Message);
323 // ProjectData.ClearProjectError();
325 this.GHTSubTestEnd();
326 this.GHTSubTestBegin("HyperLinkColumn.All");
329 if (!this.Page.IsPostBack)
331 column4.Text = "test";
332 column4.DataNavigateUrlFormatString = "test.aspx?id={0}";
333 column4.Target = "_blank";
334 column4.NavigateUrl = "test";
335 column4.DataTextField = "StringValue";
336 column4.DataNavigateUrlField = "StringValue";
337 column4.DataTextFormatString = "{0:C}";
341 this.GHTSubTestAddResult(column4.Text);
342 this.GHTSubTestAddResult(column4.DataNavigateUrlFormatString);
343 this.GHTSubTestAddResult(column4.Target);
344 this.GHTSubTestAddResult(column4.NavigateUrl);
345 this.GHTSubTestAddResult(column4.DataTextField);
346 this.GHTSubTestAddResult(column4.DataNavigateUrlField);
347 this.GHTSubTestAddResult(column4.DataTextFormatString);
350 catch (Exception exception57)
352 // ProjectData.SetProjectError(exception57);
353 Exception exception9 = exception57;
354 this.GHTSubTestAddResult("Unxpected " + exception9.GetType().Name + " exception was caught-" + exception9.Message);
355 // ProjectData.ClearProjectError();
357 this.GHTSubTestEnd();
358 this.GHTSubTestBegin("ButtonColumn.All");
361 column2 = (ButtonColumn) grid1.Columns[4];
362 if (!this.Page.IsPostBack)
364 column2.DataTextField = "StringValue";
365 //column2.ButtonType = (ButtonColumnType) "test";
366 column2.DataTextFormatString = "{0:C}";
370 this.GHTSubTestAddResult(column2.DataTextField);
371 this.GHTSubTestAddResult(((int) column2.ButtonType).ToString());
372 this.GHTSubTestAddResult(column2.DataTextFormatString);
375 catch (Exception exception58)
377 // ProjectData.SetProjectError(exception58);
378 Exception exception10 = exception58;
379 this.GHTSubTestAddResult("Unxpected " + exception10.GetType().Name + " exception was caught-" + exception10.Message);
380 // ProjectData.ClearProjectError();
382 this.GHTSubTestEnd();
383 this.GHTSubTestBegin("EditCommandColumn.All");
386 column3 = (EditCommandColumn) grid1.Columns[5];
387 if (!this.Page.IsPostBack)
389 column3.UpdateText = "test";
390 column3.CancelText = "test";
391 column3.EditText = "test";
392 column3.ButtonType = ButtonColumnType.PushButton;
396 this.GHTSubTestAddResult(column3.UpdateText);
397 this.GHTSubTestAddResult(column3.CancelText);
398 this.GHTSubTestAddResult(column3.EditText);
399 this.GHTSubTestAddResult(((int) column3.ButtonType).ToString());
402 catch (Exception exception59)
404 // ProjectData.SetProjectError(exception59);
405 Exception exception11 = exception59;
406 this.GHTSubTestAddResult("Unxpected " + exception11.GetType().Name + " exception was caught-" + exception11.Message);
407 // ProjectData.ClearProjectError();
409 this.GHTSubTestEnd();
410 this.GHTSubTestBegin("Calendar.All");
413 Calendar calendar1 = new Calendar();
414 calendar1.ID = "objCalendarAll";
415 base.GHTActiveForm.Controls.Add(calendar1);
416 if (!this.Page.IsPostBack)
418 calendar1.ShowDayHeader = true;
419 calendar1.FirstDayOfWeek = FirstDayOfWeek.Tuesday;
420 calendar1.SelectWeekText = "SelectWeekText";
421 calendar1.CellSpacing = 4;
422 calendar1.CellPadding = 6;
423 calendar1.SelectMonthText = "SelectMonthText";
424 calendar1.VisibleDate = DateTime.Now;
425 calendar1.DayNameFormat = DayNameFormat.FirstTwoLetters;
426 calendar1.ShowGridLines = true;
427 calendar1.TodaysDate = DateTime.Now.AddDays(1);
428 calendar1.ShowNextPrevMonth = true;
429 calendar1.ShowTitle = true;
430 calendar1.TitleFormat = TitleFormat.MonthYear;
431 calendar1.NextMonthText = "NextMonthText";
432 calendar1.NextPrevFormat = NextPrevFormat.FullMonth;
433 calendar1.PrevMonthText = "PrevMonthText";
434 calendar1.SelectionMode = CalendarSelectionMode.DayWeekMonth;
438 this.GHTSubTestAddResult(calendar1.ShowDayHeader.ToString());
439 this.GHTSubTestAddResult(((int) calendar1.FirstDayOfWeek).ToString());
440 this.GHTSubTestAddResult(calendar1.SelectWeekText);
441 this.GHTSubTestAddResult(calendar1.CellSpacing.ToString());
442 this.GHTSubTestAddResult(calendar1.CellPadding.ToString());
443 this.GHTSubTestAddResult(calendar1.SelectMonthText);
444 this.GHTSubTestAddResult(calendar1.VisibleDate.ToString());
445 this.GHTSubTestAddResult(((int) calendar1.DayNameFormat).ToString());
446 this.GHTSubTestAddResult(calendar1.ShowGridLines.ToString());
447 this.GHTSubTestAddResult(calendar1.TodaysDate.ToString());
448 this.GHTSubTestAddResult(calendar1.ShowNextPrevMonth.ToString());
449 this.GHTSubTestAddResult(calendar1.ShowTitle.ToString());
450 this.GHTSubTestAddResult(((int) calendar1.TitleFormat).ToString());
451 this.GHTSubTestAddResult(calendar1.NextMonthText);
452 this.GHTSubTestAddResult(((int) calendar1.NextPrevFormat).ToString());
453 this.GHTSubTestAddResult(calendar1.PrevMonthText);
454 this.GHTSubTestAddResult(((int) calendar1.SelectionMode).ToString());
457 catch (Exception exception60)
459 // ProjectData.SetProjectError(exception60);
460 Exception exception12 = exception60;
461 this.GHTSubTestAddResult("Unxpected " + exception12.GetType().Name + " exception was caught-" + exception12.Message);
462 // ProjectData.ClearProjectError();
464 this.GHTSubTestEnd();
465 this.GHTSubTestBegin("CheckBox.TextAlign,Text,Checked,AutoPostBack");
468 CheckBox box2 = new CheckBox();
469 box2.ID = "objCheckBoxAll";
470 base.GHTActiveForm.Controls.Add(box2);
471 if (!this.Page.IsPostBack)
473 box2.TextAlign = TextAlign.Left;
480 this.GHTSubTestAddResult(((int) box2.TextAlign).ToString());
481 this.GHTSubTestAddResult(box2.Text);
482 this.GHTSubTestAddResult(box2.Checked.ToString());
483 this.GHTSubTestAddResult(box2.Checked.ToString());
486 catch (Exception exception61)
488 // ProjectData.SetProjectError(exception61);
489 Exception exception13 = exception61;
490 this.GHTSubTestAddResult("Unxpected " + exception13.GetType().Name + " exception was caught-" + exception13.Message);
491 // ProjectData.ClearProjectError();
493 this.GHTSubTestEnd();
494 this.GHTSubTestBegin("CheckBoxList.RepeatColumns");
497 CheckBoxList list1 = new CheckBoxList();
498 list1.ID = "objCheckBoxListRepeatColumns";
499 base.GHTActiveForm.Controls.Add(list1);
500 if (!this.Page.IsPostBack)
502 list1.RepeatColumns = 2;
506 this.GHTSubTestAddResult(list1.RepeatColumns.ToString());
509 catch (Exception exception62)
511 // ProjectData.SetProjectError(exception62);
512 Exception exception14 = exception62;
513 this.GHTSubTestAddResult("Unxpected " + exception14.GetType().Name + " exception was caught-" + exception14.Message);
514 // ProjectData.ClearProjectError();
516 this.GHTSubTestEnd();
517 this.GHTSubTestBegin("CheckBoxList.TextAlign");
520 CheckBoxList list2 = new CheckBoxList();
521 list2.ID = "objCheckBoxListTextAlign";
522 base.GHTActiveForm.Controls.Add(list2);
523 if (!this.Page.IsPostBack)
525 list2.TextAlign = TextAlign.Right;
529 this.GHTSubTestAddResult(((int) list2.TextAlign).ToString());
532 catch (Exception exception63)
534 // ProjectData.SetProjectError(exception63);
535 Exception exception15 = exception63;
536 this.GHTSubTestAddResult("Unxpected " + exception15.GetType().Name + " exception was caught-" + exception15.Message);
537 // ProjectData.ClearProjectError();
539 this.GHTSubTestEnd();
540 this.GHTSubTestBegin("CheckBoxList.RepeatDirection");
543 CheckBoxList list3 = new CheckBoxList();
544 list3.ID = "objCheckBoxListRepeatDirection";
545 base.GHTActiveForm.Controls.Add(list3);
546 if (!this.Page.IsPostBack)
548 list3.RepeatDirection = RepeatDirection.Horizontal;
552 this.GHTSubTestAddResult(((int) list3.RepeatDirection).ToString());
555 catch (Exception exception64)
557 // ProjectData.SetProjectError(exception64);
558 Exception exception16 = exception64;
559 this.GHTSubTestAddResult("Unxpected " + exception16.GetType().Name + " exception was caught-" + exception16.Message);
560 // ProjectData.ClearProjectError();
562 this.GHTSubTestEnd();
563 this.GHTSubTestBegin("CheckBoxList.RepeatLayout");
566 CheckBoxList list4 = new CheckBoxList();
567 list4.ID = "objCheckBoxListRepeatLayout";
568 base.GHTActiveForm.Controls.Add(list4);
569 if (!this.Page.IsPostBack)
571 list4.RepeatLayout = RepeatLayout.Table;
575 this.GHTSubTestAddResult(((int) list4.RepeatLayout).ToString());
578 catch (Exception exception65)
580 // ProjectData.SetProjectError(exception65);
581 Exception exception17 = exception65;
582 this.GHTSubTestAddResult("Unxpected " + exception17.GetType().Name + " exception was caught-" + exception17.Message);
583 // ProjectData.ClearProjectError();
585 this.GHTSubTestEnd();
586 TextBox box1 = new TextBox();
587 box1.ID = "objControlToValidate";
588 base.GHTActiveForm.Controls.Add(box1);
589 this.GHTSubTestBegin("CompareValidator.Operator");
592 CompareValidator validator1 = new CompareValidator();
593 validator1.ID = "objCompareValidatorOperator";
594 validator1.ControlToValidate = "objControlToValidate";
595 base.GHTActiveForm.Controls.Add(validator1);
596 if (!this.Page.IsPostBack)
598 validator1.Operator = ValidationCompareOperator.GreaterThan;
602 this.GHTSubTestAddResult(((int) validator1.Operator).ToString());
605 catch (Exception exception66)
607 // ProjectData.SetProjectError(exception66);
608 Exception exception18 = exception66;
609 this.GHTSubTestAddResult("Unxpected " + exception18.GetType().Name + " exception was caught-" + exception18.Message);
610 // ProjectData.ClearProjectError();
612 this.GHTSubTestEnd();
613 this.GHTSubTestBegin("CompareValidator.ControlToCompare");
616 CompareValidator validator2 = new CompareValidator();
617 validator2.ID = "objCompareValidatorControlToCompare";
618 validator2.ControlToValidate = "objControlToValidate";
619 base.GHTActiveForm.Controls.Add(validator2);
620 if (!this.Page.IsPostBack)
622 validator2.ControlToValidate = "objControlToValidate";
626 this.GHTSubTestAddResult(validator2.ControlToValidate);
629 catch (Exception exception67)
631 // ProjectData.SetProjectError(exception67);
632 Exception exception19 = exception67;
633 this.GHTSubTestAddResult("Unxpected " + exception19.GetType().Name + " exception was caught-" + exception19.Message);
634 // ProjectData.ClearProjectError();
636 this.GHTSubTestEnd();
637 this.GHTSubTestBegin("CompareValidator.ValueToCompare");
640 CompareValidator validator3 = new CompareValidator();
641 validator3.ID = "objCompareValidatorValueToCompare";
642 validator3.ControlToValidate = "objControlToValidate";
643 base.GHTActiveForm.Controls.Add(validator3);
644 if (!this.Page.IsPostBack)
646 validator3.ValueToCompare = "test";
650 this.GHTSubTestAddResult(validator3.ValueToCompare);
653 catch (Exception exception68)
655 // ProjectData.SetProjectError(exception68);
656 Exception exception20 = exception68;
657 this.GHTSubTestAddResult("Unxpected " + exception20.GetType().Name + " exception was caught-" + exception20.Message);
658 // ProjectData.ClearProjectError();
660 this.GHTSubTestEnd();
661 this.GHTSubTestBegin("HtmlButton.CausesValidation");
664 HtmlButton button4 = new HtmlButton();
665 button4.ID = "objHtmlButtonCausesValidation";
666 base.GHTActiveForm.Controls.Add(button4);
667 if (!this.Page.IsPostBack)
669 button4.CausesValidation = true;
673 this.GHTSubTestAddResult(button4.CausesValidation.ToString());
676 catch (Exception exception69)
678 // ProjectData.SetProjectError(exception69);
679 Exception exception21 = exception69;
680 this.GHTSubTestAddResult("Unxpected " + exception21.GetType().Name + " exception was caught-" + exception21.Message);
681 // ProjectData.ClearProjectError();
683 this.GHTSubTestEnd();
684 this.GHTSubTestBegin("HtmlInputImage.CausesValidation");
687 HtmlInputImage image1 = new HtmlInputImage();
688 image1.ID = "objHtmlInputImageCausesValidation";
689 base.GHTActiveForm.Controls.Add(image1);
690 if (!this.Page.IsPostBack)
692 image1.CausesValidation = true;
696 this.GHTSubTestAddResult(image1.CausesValidation.ToString());
699 catch (Exception exception70)
701 // ProjectData.SetProjectError(exception70);
702 Exception exception22 = exception70;
703 this.GHTSubTestAddResult("Unxpected " + exception22.GetType().Name + " exception was caught-" + exception22.Message);
704 // ProjectData.ClearProjectError();
706 this.GHTSubTestEnd();
707 this.GHTSubTestBegin("HtmlInputButton.CausesValidation");
710 HtmlInputButton button5 = new HtmlInputButton();
711 button5.ID = "objHtmlInputButtonCausesValidation";
712 base.GHTActiveForm.Controls.Add(button5);
713 if (!this.Page.IsPostBack)
715 button5.CausesValidation = true;
719 this.GHTSubTestAddResult(button5.CausesValidation.ToString());
722 catch (Exception exception71)
724 // ProjectData.SetProjectError(exception71);
725 Exception exception23 = exception71;
726 this.GHTSubTestAddResult("Unxpected " + exception23.GetType().Name + " exception was caught-" + exception23.Message);
727 // ProjectData.ClearProjectError();
729 this.GHTSubTestEnd();
730 this.GHTSubTestBegin("HyperLink.Text");
733 HyperLink link1 = new HyperLink();
734 link1.ID = "objHyperLinkText";
735 base.GHTActiveForm.Controls.Add(link1);
736 if (!this.Page.IsPostBack)
742 this.GHTSubTestAddResult(link1.Text);
745 catch (Exception exception72)
747 // ProjectData.SetProjectError(exception72);
748 Exception exception24 = exception72;
749 this.GHTSubTestAddResult("Unxpected " + exception24.GetType().Name + " exception was caught-" + exception24.Message);
750 // ProjectData.ClearProjectError();
752 this.GHTSubTestEnd();
753 this.GHTSubTestBegin("HyperLink.Target");
756 HyperLink link2 = new HyperLink();
757 link2.ID = "objHyperLinkTarget";
758 base.GHTActiveForm.Controls.Add(link2);
759 if (!this.Page.IsPostBack)
761 link2.Target = "_blank";
765 this.GHTSubTestAddResult(link2.Target);
768 catch (Exception exception73)
770 // ProjectData.SetProjectError(exception73);
771 Exception exception25 = exception73;
772 this.GHTSubTestAddResult("Unxpected " + exception25.GetType().Name + " exception was caught-" + exception25.Message);
773 // ProjectData.ClearProjectError();
775 this.GHTSubTestEnd();
776 this.GHTSubTestBegin("HyperLink.ImageUrl");
779 HyperLink link3 = new HyperLink();
780 link3.ID = "objHyperLinkImageUrl";
781 base.GHTActiveForm.Controls.Add(link3);
782 if (!this.Page.IsPostBack)
784 link3.ImageUrl = "test";
788 this.GHTSubTestAddResult(link3.ImageUrl);
791 catch (Exception exception74)
793 // ProjectData.SetProjectError(exception74);
794 Exception exception26 = exception74;
795 this.GHTSubTestAddResult("Unxpected " + exception26.GetType().Name + " exception was caught-" + exception26.Message);
796 // ProjectData.ClearProjectError();
798 this.GHTSubTestEnd();
799 this.GHTSubTestBegin("HyperLink.NavigateUrl");
802 HyperLink link4 = new HyperLink();
803 link4.ID = "objHyperLinkNavigateUrl";
804 base.GHTActiveForm.Controls.Add(link4);
805 if (!this.Page.IsPostBack)
807 link4.NavigateUrl = "test";
811 this.GHTSubTestAddResult(link4.NavigateUrl);
814 catch (Exception exception75)
816 // ProjectData.SetProjectError(exception75);
817 Exception exception27 = exception75;
818 this.GHTSubTestAddResult("Unxpected " + exception27.GetType().Name + " exception was caught-" + exception27.Message);
819 // ProjectData.ClearProjectError();
821 this.GHTSubTestEnd();
822 this.GHTSubTestBegin("Image.AlternateText");
825 Image image2 = new Image();
826 image2.ID = "objImageAlternateText";
827 base.GHTActiveForm.Controls.Add(image2);
828 if (!this.Page.IsPostBack)
830 image2.AlternateText = "test";
834 this.GHTSubTestAddResult(image2.AlternateText);
837 catch (Exception exception76)
839 // ProjectData.SetProjectError(exception76);
840 Exception exception28 = exception76;
841 this.GHTSubTestAddResult("Unxpected " + exception28.GetType().Name + " exception was caught-" + exception28.Message);
842 // ProjectData.ClearProjectError();
844 this.GHTSubTestEnd();
845 this.GHTSubTestBegin("Image.ImageAlign");
848 Image image3 = new Image();
849 image3.ID = "objImageImageAlign";
850 base.GHTActiveForm.Controls.Add(image3);
851 if (!this.Page.IsPostBack)
853 image3.ImageAlign = ImageAlign.Right;
857 this.GHTSubTestAddResult(((int) image3.ImageAlign).ToString());
860 catch (Exception exception77)
862 // ProjectData.SetProjectError(exception77);
863 Exception exception29 = exception77;
864 this.GHTSubTestAddResult("Unxpected " + exception29.GetType().Name + " exception was caught-" + exception29.Message);
865 // ProjectData.ClearProjectError();
867 this.GHTSubTestEnd();
868 this.GHTSubTestBegin("Image.ImageUrl");
871 Image image4 = new Image();
872 image4.ID = "objImageImageUrl";
873 base.GHTActiveForm.Controls.Add(image4);
874 if (!this.Page.IsPostBack)
876 image4.ImageUrl = "test";
880 this.GHTSubTestAddResult(image4.ImageUrl);
883 catch (Exception exception78)
885 // ProjectData.SetProjectError(exception78);
886 Exception exception30 = exception78;
887 this.GHTSubTestAddResult("Unxpected " + exception30.GetType().Name + " exception was caught-" + exception30.Message);
888 // ProjectData.ClearProjectError();
890 this.GHTSubTestEnd();
891 this.GHTSubTestBegin("ImageButton.CommandName");
894 ImageButton button6 = new ImageButton();
895 button6.ID = "objImageButtonCommandName";
896 base.GHTActiveForm.Controls.Add(button6);
897 if (!this.Page.IsPostBack)
899 button6.CommandName = "test";
903 this.GHTSubTestAddResult(button6.CommandName);
906 catch (Exception exception79)
908 // ProjectData.SetProjectError(exception79);
909 Exception exception31 = exception79;
910 this.GHTSubTestAddResult("Unxpected " + exception31.GetType().Name + " exception was caught-" + exception31.Message);
911 // ProjectData.ClearProjectError();
913 this.GHTSubTestEnd();
914 this.GHTSubTestBegin("ImageButton.CommandArgument");
917 ImageButton button7 = new ImageButton();
918 button7.ID = "objImageButtonCommandArgument";
919 base.GHTActiveForm.Controls.Add(button7);
920 if (!this.Page.IsPostBack)
922 button7.CommandArgument = "test";
926 this.GHTSubTestAddResult(button7.CommandArgument);
929 catch (Exception exception80)
931 // ProjectData.SetProjectError(exception80);
932 Exception exception32 = exception80;
933 this.GHTSubTestAddResult("Unxpected " + exception32.GetType().Name + " exception was caught-" + exception32.Message);
934 // ProjectData.ClearProjectError();
936 this.GHTSubTestEnd();
937 this.GHTSubTestBegin("ImageButton.CommandName");
940 ImageButton button8 = new ImageButton();
941 button8.ID = "objImageButtonCausesValidation";
942 base.GHTActiveForm.Controls.Add(button8);
943 if (!this.Page.IsPostBack)
945 button8.CausesValidation = true;
949 this.GHTSubTestAddResult(button8.CausesValidation.ToString());
952 catch (Exception exception81)
954 // ProjectData.SetProjectError(exception81);
955 Exception exception33 = exception81;
956 this.GHTSubTestAddResult("Unxpected " + exception33.GetType().Name + " exception was caught-" + exception33.Message);
957 // ProjectData.ClearProjectError();
959 this.GHTSubTestEnd();
960 this.GHTSubTestBegin("Label.Text");
963 Label label2 = new Label();
964 label2.ID = "objLabelText";
965 base.GHTActiveForm.Controls.Add(label2);
966 if (!this.Page.IsPostBack)
968 label2.Text = "test";
972 this.GHTSubTestAddResult(label2.Text);
975 catch (Exception exception82)
977 // ProjectData.SetProjectError(exception82);
978 Exception exception34 = exception82;
979 this.GHTSubTestAddResult("Unxpected " + exception34.GetType().Name + " exception was caught-" + exception34.Message);
980 // ProjectData.ClearProjectError();
982 this.GHTSubTestEnd();
983 this.GHTSubTestBegin("LinkButton.CausesValidation");
986 LinkButton button9 = new LinkButton();
987 button9.ID = "objLinkButtonCausesValidation";
988 base.GHTActiveForm.Controls.Add(button9);
989 if (!this.Page.IsPostBack)
991 button9.CausesValidation = true;
995 this.GHTSubTestAddResult(button9.CausesValidation.ToString());
998 catch (Exception exception83)
1000 // ProjectData.SetProjectError(exception83);
1001 Exception exception35 = exception83;
1002 this.GHTSubTestAddResult("Unxpected " + exception35.GetType().Name + " exception was caught-" + exception35.Message);
1003 // ProjectData.ClearProjectError();
1005 this.GHTSubTestEnd();
1006 this.GHTSubTestBegin("LinkButton.CommandName");
1009 LinkButton button10 = new LinkButton();
1010 button10.ID = "objLinkButtonCommandName";
1011 base.GHTActiveForm.Controls.Add(button10);
1012 if (!this.Page.IsPostBack)
1014 button10.CommandName = "test";
1018 this.GHTSubTestAddResult(button10.CommandName);
1021 catch (Exception exception84)
1023 // ProjectData.SetProjectError(exception84);
1024 Exception exception36 = exception84;
1025 this.GHTSubTestAddResult("Unxpected " + exception36.GetType().Name + " exception was caught-" + exception36.Message);
1026 // ProjectData.ClearProjectError();
1028 this.GHTSubTestEnd();
1029 this.GHTSubTestBegin("LinkButton.CommandArgument");
1032 LinkButton button11 = new LinkButton();
1033 button11.ID = "objLinkButtonCommandArgument";
1034 base.GHTActiveForm.Controls.Add(button11);
1035 if (!this.Page.IsPostBack)
1037 button11.CommandArgument = "test";
1041 this.GHTSubTestAddResult(button11.CommandArgument);
1044 catch (Exception exception85)
1046 // ProjectData.SetProjectError(exception85);
1047 Exception exception37 = exception85;
1048 this.GHTSubTestAddResult("Unxpected " + exception37.GetType().Name + " exception was caught-" + exception37.Message);
1049 // ProjectData.ClearProjectError();
1051 this.GHTSubTestEnd();
1052 this.GHTSubTestBegin("LinkButton.Text");
1055 LinkButton button12 = new LinkButton();
1056 button12.ID = "objLinkButtonText";
1057 base.GHTActiveForm.Controls.Add(button12);
1058 if (!this.Page.IsPostBack)
1060 button12.Text = "test";
1064 this.GHTSubTestAddResult(button12.Text);
1067 catch (Exception exception86)
1069 // ProjectData.SetProjectError(exception86);
1070 Exception exception38 = exception86;
1071 this.GHTSubTestAddResult("Unxpected " + exception38.GetType().Name + " exception was caught-" + exception38.Message);
1072 // ProjectData.ClearProjectError();
1074 this.GHTSubTestEnd();
1075 this.GHTSubTestBegin("ListBox.All");
1078 ListBox box3 = new ListBox();
1079 box3.ID = "objListBoxAll";
1080 base.GHTActiveForm.Controls.Add(box3);
1081 if (!this.Page.IsPostBack)
1083 box3.SelectionMode = ListSelectionMode.Multiple;
1088 this.GHTSubTestAddResult(((int) box3.SelectionMode).ToString());
1089 this.GHTSubTestAddResult(box3.Rows.ToString());
1092 catch (Exception exception87)
1094 // ProjectData.SetProjectError(exception87);
1095 Exception exception39 = exception87;
1096 this.GHTSubTestAddResult("Unxpected " + exception39.GetType().Name + " exception was caught-" + exception39.Message);
1097 // ProjectData.ClearProjectError();
1099 this.GHTSubTestEnd();
1100 this.GHTSubTestBegin("ListControl.All");
1103 ListBox box4 = new ListBox();
1104 box4.ID = "objListControlAll";
1105 box4.DataSource = this.CreateDataSource();
1107 base.GHTActiveForm.Controls.Add(box4);
1108 if (!this.Page.IsPostBack)
1110 box4.AutoPostBack = true;
1111 box4.DataMember = "test";
1112 box4.DataTextField = "StringValue";
1113 box4.DataTextFormatString = "{0:C}";
1114 box4.DataValueField = "StringValue";
1118 this.GHTSubTestAddResult(box4.AutoPostBack.ToString());
1119 this.GHTSubTestAddResult(box4.DataMember);
1120 this.GHTSubTestAddResult(box4.DataTextField);
1121 this.GHTSubTestAddResult(box4.DataTextFormatString);
1122 this.GHTSubTestAddResult(box4.DataValueField);
1125 catch (Exception exception88)
1127 // ProjectData.SetProjectError(exception88);
1128 Exception exception40 = exception88;
1129 this.GHTSubTestAddResult("Unxpected " + exception40.GetType().Name + " exception was caught-" + exception40.Message);
1130 // ProjectData.ClearProjectError();
1132 this.GHTSubTestEnd();
1133 this.GHTSubTestBegin("Literal.Text");
1136 Literal literal1 = new Literal();
1137 literal1.ID = "objLiteralText";
1138 base.GHTActiveForm.Controls.Add(literal1);
1139 if (!this.Page.IsPostBack)
1141 literal1.Text = "test";
1145 this.GHTSubTestAddResult(literal1.Text);
1148 catch (Exception exception89)
1150 // ProjectData.SetProjectError(exception89);
1151 Exception exception41 = exception89;
1152 this.GHTSubTestAddResult("Unxpected " + exception41.GetType().Name + " exception was caught-" + exception41.Message);
1153 // ProjectData.ClearProjectError();
1155 this.GHTSubTestEnd();
1156 this.GHTSubTestBegin("Panel.All");
1159 Panel panel1 = new Panel();
1160 panel1.ID = "objPanelAll";
1161 base.GHTActiveForm.Controls.Add(panel1);
1162 if (!this.Page.IsPostBack)
1164 panel1.BackImageUrl = "test";
1165 panel1.HorizontalAlign = HorizontalAlign.Right;
1170 this.GHTSubTestAddResult(panel1.BackImageUrl);
1171 this.GHTSubTestAddResult(((int) panel1.HorizontalAlign).ToString());
1172 this.GHTSubTestAddResult(panel1.Wrap.ToString());
1175 catch (Exception exception90)
1177 // ProjectData.SetProjectError(exception90);
1178 Exception exception42 = exception90;
1179 this.GHTSubTestAddResult("Unxpected " + exception42.GetType().Name + " exception was caught-" + exception42.Message);
1180 // ProjectData.ClearProjectError();
1182 this.GHTSubTestEnd();
1183 this.GHTSubTestBegin("RadioButton.GroupName");
1186 RadioButton button13 = new RadioButton();
1187 button13.ID = "objRadioButtonGroupName";
1188 base.GHTActiveForm.Controls.Add(button13);
1189 if (!this.Page.IsPostBack)
1191 button13.GroupName = "test";
1195 this.GHTSubTestAddResult(button13.GroupName);
1198 catch (Exception exception91)
1200 // ProjectData.SetProjectError(exception91);
1201 Exception exception43 = exception91;
1202 this.GHTSubTestAddResult("Unxpected " + exception43.GetType().Name + " exception was caught-" + exception43.Message);
1203 // ProjectData.ClearProjectError();
1205 this.GHTSubTestEnd();
1206 this.GHTSubTestBegin("RadioButtonList.RepeatColumns");
1209 RadioButtonList list5 = new RadioButtonList();
1210 list5.ID = "objRadioButtonListRepeatColumns";
1211 base.GHTActiveForm.Controls.Add(list5);
1212 if (!this.Page.IsPostBack)
1214 list5.RepeatColumns = 2;
1218 this.GHTSubTestAddResult(list5.RepeatColumns.ToString());
1221 catch (Exception exception92)
1223 // ProjectData.SetProjectError(exception92);
1224 Exception exception44 = exception92;
1225 this.GHTSubTestAddResult("Unxpected " + exception44.GetType().Name + " exception was caught-" + exception44.Message);
1226 // ProjectData.ClearProjectError();
1228 this.GHTSubTestEnd();
1229 this.GHTSubTestBegin("RadioButtonList.RepeatDirection");
1232 RadioButtonList list6 = new RadioButtonList();
1233 list6.ID = "objRadioButtonListRepeatDirection";
1234 base.GHTActiveForm.Controls.Add(list6);
1235 if (!this.Page.IsPostBack)
1237 list6.RepeatDirection = RepeatDirection.Horizontal;
1241 this.GHTSubTestAddResult(((int) list6.RepeatDirection).ToString());
1244 catch (Exception exception93)
1246 // ProjectData.SetProjectError(exception93);
1247 Exception exception45 = exception93;
1248 this.GHTSubTestAddResult("Unxpected " + exception45.GetType().Name + " exception was caught-" + exception45.Message);
1249 // ProjectData.ClearProjectError();
1251 this.GHTSubTestEnd();
1252 this.GHTSubTestBegin("RadioButtonList.TextAlign");
1255 RadioButtonList list7 = new RadioButtonList();
1256 list7.ID = "objRadioButtonListTextAlign";
1257 base.GHTActiveForm.Controls.Add(list7);
1258 if (!this.Page.IsPostBack)
1260 list7.TextAlign = TextAlign.Right;
1264 this.GHTSubTestAddResult(((int) list7.TextAlign).ToString());
1267 catch (Exception exception94)
1269 // ProjectData.SetProjectError(exception94);
1270 Exception exception46 = exception94;
1271 this.GHTSubTestAddResult("Unxpected " + exception46.GetType().Name + " exception was caught-" + exception46.Message);
1272 // ProjectData.ClearProjectError();
1274 this.GHTSubTestEnd();
1275 this.GHTSubTestBegin("RadioButtonList.RepeatLayout");
1278 RadioButtonList list8 = new RadioButtonList();
1279 list8.ID = "objRadioButtonListRepeatLayout";
1280 base.GHTActiveForm.Controls.Add(list8);
1281 if (!this.Page.IsPostBack)
1283 list8.RepeatLayout = RepeatLayout.Flow;
1287 this.GHTSubTestAddResult(((int) list8.RepeatLayout).ToString());
1290 catch (Exception exception95)
1292 // ProjectData.SetProjectError(exception95);
1293 Exception exception47 = exception95;
1294 this.GHTSubTestAddResult("Unxpected " + exception47.GetType().Name + " exception was caught-" + exception47.Message);
1295 // ProjectData.ClearProjectError();
1297 this.GHTSubTestEnd();
1298 this.GHTSubTestBegin("TextBox.ReadOnly,AutoPostBack,Columns,Wrap,Text,Rows,MaxLength,TextMode");
1301 TextBox box5 = new TextBox();
1302 box5.ID = "objTextBoxAll";
1303 base.GHTActiveForm.Controls.Add(box5);
1304 if (!this.Page.IsPostBack)
1306 box5.ReadOnly = true;
1307 box5.AutoPostBack = true;
1312 box5.MaxLength = 10;
1313 box5.TextMode = TextBoxMode.MultiLine;
1317 this.GHTSubTestAddResult(box5.ReadOnly.ToString());
1318 this.GHTSubTestAddResult(box5.ReadOnly.ToString());
1319 this.GHTSubTestAddResult(box5.AutoPostBack.ToString());
1320 this.GHTSubTestAddResult(box5.Columns.ToString());
1321 this.GHTSubTestAddResult(box5.Wrap.ToString());
1322 this.GHTSubTestAddResult(box5.Text);
1323 this.GHTSubTestAddResult(box5.Rows.ToString());
1324 this.GHTSubTestAddResult(box5.MaxLength.ToString());
1325 this.GHTSubTestAddResult(((int) box5.TextMode).ToString());
1328 catch (Exception exception96)
1330 // ProjectData.SetProjectError(exception96);
1331 Exception exception48 = exception96;
1332 this.GHTSubTestAddResult("Unxpected " + exception48.GetType().Name + " exception was caught-" + exception48.Message);
1333 // ProjectData.ClearProjectError();
1335 this.GHTSubTestEnd();
1339 private ICollection CreateDataSource()
1341 DataTable table1 = new DataTable();
1342 table1.TableName = "test";
1343 table1.Columns.Add(new DataColumn("IntegerValue", typeof(int)));
1344 table1.Columns.Add(new DataColumn("StringValue", typeof(string)));
1345 table1.Columns.Add(new DataColumn("CurrencyValue", typeof(double)));
1349 DataRow row1 = table1.NewRow();
1351 row1[1] = "Item " + num1.ToString();
1352 row1[2] = 1.23 * (num1 + 1);
1353 table1.Rows.Add(row1);
1357 return new DataView(table1);