How to use an AdRotator in ASP.NET
<asp:AdRotator id=’AdRotator1′ AdvertisementFile=’adrot.xml’ runat=’server’ Width=’468px’ Height=’60px’></asp:AdRotator> adrot.xml <Advertisements> <Ad> <ImageUrl>b2346.jpg</ImageUrl> <NavigateUrl>http://ww.syncfusion.com</NavigateUrl> <AlternateText> The site for ASP.Net FAQs </AlternateText> <Impressions>5</Impressions> </Ad> </Advertisements>
How to retrieve the multiple selected items in a CheckBoxList
<asp:CheckBoxList id=’CheckBoxList1′ runat=’server’> <asp:ListItem Value=’Faq’>Faq</asp:ListItem> <asp:ListItem Value=’Tips’>Tips</asp:ListItem> <asp:ListItem Value=’Tricks’>Tricks</asp:ListItem> </asp:CheckBoxList> <asp:Button id=’btnShow’ style=’Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 136px’ runat=’server’ Text=’Show’></asp:Button> VB.NET Private Sub btnShow_Click(sender As Object, e As System.EventArgs) Dim strchklist As String = ” Dim li As ListItem For Each li In CheckBoxList1.Items If li.Selected Then strchklist += li.Text + ‘ ‘ End If Next If strchklist = ” Then Response.Write(‘No item Selected’) Else Response.Write((‘You selected : ‘ + strchklist)) End If End Sub ’btnShow_Click C# private void btnShow_Click(object sender, System.EventArgs e) { string strchklist=”; foreach (ListItem li in CheckBoxList1.Items ) { if (li.Selected ) { strchklist += li.Text + ‘ ‘ ; } } if (strchklist ==”) { Response.Write (‘No item Selected’); } else { Response.Write (‘You selected : ‘ + strchklist); } }
How to use the <asp:xml> tag
<asp:Xml id=’Xml1′ DocumentSource=’products.xml’ runat=’server’></asp:Xml>
How to change the Page Title dynamically
<TITLE id=’Title1′ runat =server ></TITLE> VB.NET ’Declare Protected WithEvents Title1 As System.Web.UI.HtmlControls.HtmlGenericControl ’In Page_Load Title1.InnerText =’Page 1′ C# //Declare protected System.Web.UI.HtmlControls.HtmlGenericControl Title1 ; //In Page_Load Title1.InnerText =’Page 1′ ;
How can I specify the ‘upload a file’ input textbox in a form to be read only so that the user can click on the browse button and pick a file but they cannot type anything into the textbox next to the browse button.
<input id=’File1′ type=’file’ contenteditable=false />