How to Programmatically change backgroundcolor of a Calendar Control using Dropdown List
<asp:Calendar id='Calendar1' style='Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 48px' runat='server'></asp:Calendar> <asp:DropDownList id='DropDownList1' style='Z-INDEX: 102; LEFT: 40px; POSITION: absolute; TOP: 24px' runat='server' AutoPostBack='True'> <asp:ListItem Value='Red'>Red</asp:ListItem> <asp:ListItem Value='Green'>Green</asp:ListItem> <asp:ListItem Value='Blue'>Blue</asp:ListItem> </asp:DropDownList> VB.NET Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged Dim colorName As String = DropDownList1.SelectedItem.Text Dim objBackColor As System.Drawing.Color = System.Drawing.Color.FromName(colorName) Calendar1.BackColor = objBackColor End Sub C# private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) { string colorName = DropDownList1.SelectedItem.Text; System.Drawing.Color objBackColor = System.Drawing.Color.FromName(colorName); Calendar1.BackColor = objBackColor; }
How can I access an MS Access database in my ASPX page, if the db is on a remote server?
To access an MS Access database from your ASP.Net page, you must use the UNC format in the path, like: \\Servername\yourpath\your.mdb To fully use the database, grant permissions to the ASPNet user account equal to ’modify’, for the folder/directory where the database exists.
How to add login user (ASPNET) to MS SQL 2000 Desktop Engine server?
Go to drive:\Program Files\Microsoft SQL Server\80\Tools\binn Use OSQL, a command line tool. osql -S servername\instancename -E -q --Line numbers will appear EXEC sp_grantlogin ’machinename\ASPNET’ go use <databasename> go EXEC sp_grantdbaccess ’machinename\ASPNET’ go EXEC sp_addrolemember ’db_owner’, ’machinename\ASPNET’ go </databasename>
How to restore the browser’s scroll position after a postback?
Set the SmartNavigation attribute to true.
How do I make my TextBox positioned below a DataGrid move up or down in position as the height of the DataGrid changes?
Specify the pageLayout of the Document from GridLayout to FlowLayout, this will position the controls automatically and optimally.