Can I use a dropdownlist to allow user to select multiple items from a list of available items
No. Dropdownlist Web Control allows user to select only one item from a list of items.
I have a page with a Dropdownlist and some simple code for the SelectedIndexChanged but it does not do a postback
If you want the dropdownlist to cause a postback when selection changes set AutoPostBack property to ‘True’ for the dropdownlist control.
How to show TextBox web server control with TextMode Property Password as **** rather than blank
For security reason, TextBox with TextMode=’Password’ setting cannot be assigned or populated via the Text property on Page_Load or PostBack event. It’s not recommend for to prefill a ‘Password’ type TextBox with the(‘***’) characters, though below is the solution to achieve this. VB.NET ViewState(‘Pwd’)=TextBox1.Text ; TextBox1.Attributes.Add(‘value’, ViewState(‘Pwd’).ToString ()) ; C# ViewState[‘Pwd’]=TextBox1.Text ; TextBox1.Attributes.Add(‘value’, ViewState[‘Pwd’].ToString ()) ;
Why do I get error message ‘Option Strict On disallows implicit conversions from ‘System.Web.UI.Control’ to ‘System.Web.UI.WebControls.TextBox’.’
For type Casting apply the following steps VB.NET dim aprtxt as string aprtxt= CType(e.Item.FindControl(‘txtapr’), TextBox) C# string aprtxt; aprtxt = (TextBox) e.Item.FindControl[‘txtapr’];
I have set the ItemStyle and the AlternatingItemStyle tags for DataGrid control but they aren’t working correctly , why?
DataGrid generates an HTML Table, with TableRows and Cells. If you already have some display properties set for <td>,<TR>… make sure to check them in the Stylesheet. Whatever properties you set there will normally override whatever you add into your DataGrid’s Item styles.