<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="gfln1.WebForm1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title></title><link href="css/styles.css" rel="stylesheet" type="text/css"/><script type="text/javascript" runat=server></script></head><body><form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="RadioButtonList1" EventName="SelectedIndexChanged" /></Triggers><ContentTemplate> <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"> <asp:ListItem Text="Blue" Value="blue"></asp:ListItem><asp:ListItem Text="Red" Value="red"></asp:ListItem><asp:ListItem Text="White" Value="white"></asp:ListItem></asp:RadioButtonList><br /><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></ContentTemplate></asp:UpdatePanel><div class="right_txt_space_accm"><asp:UpdatePanel ID="UpdatePanel2" runat="server"> <Triggers><asp:AsyncPostBackTrigger ControlID="RadioButtonList2" EventName="SelectedIndexChanged" /></Triggers><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="40%" align="left"><strong>Number of attendees:</strong></td><td width="60%" align="left"><strong><ContentTemplate><asp:RadioButtonList EnableViewState=true ID="RadioButtonList2" CellSpacing=13 RepeatDirection=Horizontal runat="server" RepeatColumns=4 AutoPostBack="true"><asp:ListItem>1</asp:ListItem><asp:ListItem>2</asp:ListItem><asp:ListItem>3</asp:ListItem><asp:ListItem>4</asp:ListItem><asp:ListItem>5</asp:ListItem><asp:ListItem>6</asp:ListItem><asp:ListItem>7</asp:ListItem></asp:RadioButtonList> </strong></td></ContentTemplate></asp:UpdatePanel></tr></table></div><asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder></form></body></html>
Public Partial Class WebForm1Inherits System.Web.UI.PageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadEnd SubProtected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)If RadioButtonList1.SelectedValue = "blue" ThenTextBox1.BackColor = System.Drawing.Color.BlueTextBox1.ForeColor = System.Drawing.Color.WhiteElseIf RadioButtonList1.SelectedValue = "red" ThenTextBox1.BackColor = System.Drawing.Color.RedTextBox1.ForeColor = System.Drawing.Color.BlackElseIf RadioButtonList1.SelectedValue = "white" ThenTextBox1.BackColor = System.Drawing.Color.WhiteTextBox1.ForeColor = System.Drawing.Color.BlackEnd IfEnd SubProtected Sub RadioButtonList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButtonList2.SelectedIndexChangedResponse.Write(RadioButtonList2.SelectedValue)Dim index As IntegerFor index = 1 To Me.RadioButtonList2.SelectedValueDim newdiv As New HtmlGenericControl("div")newdiv.EnableViewState = TrueDim ht As New HtmlTable()ht.ID = "mytable" & indexht.EnableViewState = Trueht.Width = "100%"ht.CellSpacing = "0"ht.CellPadding = "0"ht.Border = 0Dim htr, htr1, htr2 As New HtmlTableRow()Dim cell, htc, htc1, htc2, htc3, htc4, htc5, htc6, htc7, htc8 As New HtmlTableCell()Dim name_tb As New TextBox()Dim sal_ddl As New DropDownList'validatorDim name_req As New RequiredFieldValidatorDim tel_req As New RequiredFieldValidatorDim email_req As New RequiredFieldValidatorname_tb.ID = "name_tb" & indexsal_ddl.ID = "sal_ddl" & indexname_req.ID = "name_req" & indextel_req.ID = "tel_req" & indexemail_req.ID = "email_req" & indexname_tb.EnableViewState = Truesal_ddl.EnableViewState = Truetel_req.EnableViewState = Truesal_ddl.Items.Add("MR")sal_ddl.Items.Add("Ms")sal_ddl.Items.Add("Mrs")Dim Tel_tb1 As New TextBoxTel_tb1.ID = "Tel_tb1" & indexTel_tb1.EnableViewState = Truename_tb.TextMode = TextBoxMode.SingleLineDim email_tb1 As New TextBoxemail_tb1.ID = "email_tb1" & indexemail_tb1.TextMode = TextBoxMode.SingleLinehtc.InnerText = "Name : "htc.Width = "20%"htc.Align = "Left"htc1.Controls.Add(sal_ddl)htc1.Width = "10%"htc2.Width = "70%"htc2.Align = "left"htc2.Controls.Add(name_tb)htc2.Controls.Add(name_req)htr.Controls.Add(htc)htr.Controls.Add(htc1)htr.Controls.Add(htc2)ht.Controls.Add(htr)name_req.ControlToValidate = "name_tb" & indexname_req.Display = ValidatorDisplay.Dynamicname_req.ErrorMessage = ("Please Enter name of attendenes")'make 2nd row htc3.InnerText = "Telephone : "htc3.Width = "20%"htc3.Align = "Left"htc4.InnerHtml = "<strong></strong>"htc4.Width = "10%"htc5.Width = "70%"htc5.Align = "left"htc5.Controls.Add(Tel_tb1)htc5.Controls.Add(tel_req)htr1.Controls.Add(htc3)htr1.Controls.Add(htc4)htr1.Controls.Add(htc5)ht.Controls.Add(htr1)tel_req.ControlToValidate = "Tel_tb1" & indextel_req.Display = ValidatorDisplay.Dynamictel_req.ErrorMessage = ("Please Enter Phone")'make 3rd row htc6.InnerText = "Email : "htc6.Width = "20%"htc6.Align = "Left"htc7.InnerHtml = "<strong></strong>"htc7.Width = "10%"htc8.Width = "70%"htc8.Align = "left"htc8.Controls.Add(email_tb1)htc8.Controls.Add(email_req)htr2.Controls.Add(htc6)htr2.Controls.Add(htc7)htr2.Controls.Add(htc8)ht.Controls.Add(htr2)email_req.ControlToValidate = "email_tb1" & indexemail_req.Display = ValidatorDisplay.Dynamicemail_req.ErrorMessage = ("Please Enter Email")'Add a blank rowcell.ColSpan = 3cell.InnerHtml = "<br/>"Dim row As New HtmlTableRowrow.Cells.Add(cell)ht.Rows.Add(row)newdiv.Controls.Add(ht)newdiv.Attributes.Add("table", "ht")newdiv.Attributes.Add("Style", "border-bottom :#ccc solid 0px")newdiv.Attributes.Add("style", "height:23px")newdiv.Attributes.Add("style", "padding-left:20px")Me.PlaceHolder1.Controls.Add(newdiv)PlaceHolder1.EnableViewState = TrueNextEnd SubEnd Class
Line 37: </Triggers> Line 38: Line 39: <table width="100%" border="0" cellspacing="0" cellpadding="0"> Line 40: <tr> Line 41: <td width="40%" align="left"><strong>Number of