Archives
-
A Custom Dialog Box Control
http://www.codeproject.com/aspnet/customdialog.asp
-
Creating Composite Server Controls in ASP.NET 2.0
http://dotnet.sys-con.com/read/171169.htm
-
New Code Snippets for C#
* Application Code Snippets
* Collections and Arrays Code Snippets
* Connectivity Code Snippets
* Crystal Reports Code Snippets
* Database Code Snippets
* Datatypes Code Snippets
* File System Code Snippets
* Math Code Snippets
* Operating System Code Snippets
* Security Code Snippets
* Smart Devices Code Snippets
* Windows Forms Code Snippets
* XML Code Snippets
To download code snippets for all the categories and retain the directory install structure of these snippets, click here.
Tool for write Snippets click here. -
Useful Tip in ASP.NET 2.0
How to add additional drop-down values to DropDownList,
such as an initial "(Select a State)" value,
that are not part of the databound result?
Please read Scott Guthrie blog. -
Web Resource cool new feature in ASP.NET 2.0
See http://msdn.microsoft.com/system.web.ui.webresourceattribute.aspx.
-
Building XML editor in .NET 2.0
Thanks to Hannes Preishuber feedback,
I found how to write it with WebBrowser control (C# version)
object obj = webBrowser1.ActiveXInstance;
HtmlDocument hd = webBrowser1.Document;
IHTMLDocument2 axObj = hd.DomDocument as IHTMLDocument2;
axObj.designMode = "On"; -
Building XML Editor
Step 1: Open win forms
-
Dynamic role management ( by context ).
Same time we need dynamic role management ( by context ).
-
Membership and Role Providers in ASP.NET 2.0
-
Useful attributes for working with ObjectDataSource
1. DataObjectAttribute
-
éåí ùéùé îùôçúé
אני אחותו של אייל מנסה את כוחי בכתיבה ראשונה בבלוג רציתי לספר לכם שכול יום שישי אנחנו
נפגשים כל המשפחה לארוחת ערב חגיגית וכל אחד מהבאים מספר את שעבר אליו בשבוע החולף דבר
שעוזר ושומר את כולנו בתמונה המשותפת של החיים ושל המשפחה אני חייבת להיות גלויה ולהגיד שלא
קל לנו להבין את כל הרעיונות של איל אבל אנחנו מנסים המוח שלו עובד בקצב מאוד מהיר ואני מקווה
שאום מבינים מה שהוא כותב בכול אופן כולנו מבינים שמדובר כאן ביצור מוזר מכוכב אחריש לי עוד אח יותר קטן והוא סטודנט במרכז הבין תחומי בהרצליה ,לא היה לו מה לספר לנו חדש השבוע
ואני אחות שלהם לי יש זכיון של מיכל נגרין בכפר סבא ובמידה ובאמת משהוא קורא
את הבלוג הזה כמו שאיל אומר אתם מוזמנים לבוא ולהגיד לי שאתם הקוראים
ואני מבטיחה לכם הנחה שמי הילה ורדי היה נחמד וסוף שבוע טוב לכולנו
ביי
-
Add Action List to Control
Step 1 : Build the control
using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace CustomDesignerActionsDemo { [DefaultProperty( "Text" )] [ToolboxData( "<{0}:UserInfo runat=server>" )] [Designer( typeof( MyDesigner ) )] public class UserInfo : WebControl { #region Fields private int m_Age; protected TextBox txbAge; [CategoryAttribute( "Misc" )] [DescriptionAttribute( "My Age" )] public int Age { get { return m_Age; } set { m_Age = value; } } private string m_Email; protected TextBox txbEmail; [CategoryAttribute( "Misc" )] [DescriptionAttribute( "My Email" )] public string Email { get { return m_Email; } set { m_Email = value; } } private DateTime m_Date; protected TextBox txbDate; [CategoryAttribute( "Misc" )] [DescriptionAttribute( "My Date" )] public DateTime Date { get { return m_Date; } set { m_Date = value; } } private CityList m_City; protected TextBox txbCity; [CategoryAttribute( "General" )] [DescriptionAttribute( "My City" )] public CityList City { get { return m_City; } set { m_City = value; } } [Bindable( true )] [Category( "Appearance" )] [DefaultValue( "" )] [Localizable( true )] public string Text { get { String s = (String)ViewState[ "Text" ]; return ( ( s == null ) ? String.Empty : s ); } set { ViewState[ "Text" ] = value; } } #endregion bool IsCreateChildControls = false; protected void SetValueInTextBox() { txbAge.Text = Age.ToString(); txbCity.Text = City.ToString(); txbDate.Text = Date.ToString(); txbEmail.Text = Email; } protected override void EnsureChildControls() { if ( !IsCreateChildControls ) CreateChildControls(); base.EnsureChildControls(); } protected override void CreateChildControls() { txbAge = new TextBox(); txbCity = new TextBox(); txbDate = new TextBox(); txbEmail = new TextBox(); base.CreateChildControls(); IsCreateChildControls = true; } protected override void RenderContents( HtmlTextWriter output ) { EnsureChildControls(); SetValueInTextBox(); output.Write( Text ); output.Write( "
Step 2 : Build the designer for the control
City: " ); txbCity.RenderControl( output ); output.Write( "
Age: " ); txbAge.RenderControl( output ); output.Write( "
Date: " ); txbDate.RenderControl( output ); output.Write( "
Email: " ); txbEmail.RenderControl( output ); } } }using System; using System.Collections.Generic; using System.Web.UI.Design; using System.ComponentModel.Design; namespace CustomDesignerActionsDemo { public class MyDesigner : ControlDesigner { private DesignerActionListCollection al = null; public override DesignerActionListCollection ActionLists { get { if ( al == null ) { al = new DesignerActionListCollection(); al.AddRange( base.ActionLists ); // Add a custom DesignerActionList al.Add( new MyDesignerActionList( this ) ); } return al; } } } }
Step 3 : Build the action list for the designerusing System; using System.ComponentModel; using System.ComponentModel.Design; using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Windows.Forms; using System.Reflection; namespace CustomDesignerActionsDemo { public class MyDesignerActionList : DesignerActionList { MyDesigner m_parent; public MyDesignerActionList( MyDesigner parent ) : base(parent.Component) { m_parent = parent; } public override DesignerActionItemCollection GetSortedActionItems() { // Create list to store designer action items DesignerActionItemCollection actionItems = new DesignerActionItemCollection(); // Add Appearance category header text actionItems.Add(new DesignerActionHeaderItem("Misc")); //// Add Appearance category descriptive label actionItems.Add( new DesignerActionTextItem( "Properties that affect how the User looks." , "Misc" ) ); //// Add Email designer action property item actionItems.Add( new DesignerActionPropertyItem( "Email" , "Email" , GetCategory( this.WebControl , "Email" ) , GetDescription( this.WebControl , "Email" ) ) ); actionItems.Add( new DesignerActionPropertyItem( "Age" , "Age" , GetCategory( this.WebControl , "Age" ) , GetDescription( this.WebControl , "Age" ) ) ); actionItems.Add( new DesignerActionPropertyItem( "Date" , "Date" , GetCategory( this.WebControl , "Date" ) , GetDescription( this.WebControl , "Date" ) ) ); actionItems.Add( new DesignerActionPropertyItem( "City" , "City" , GetCategory( this.WebControl , "City" ) , GetDescription( this.WebControl , "City" ) ) ); actionItems.Add( new DesignerActionMethodItem( this , "ClearValues" , "Clear Values" , true ) ); // for the Propeties wondows return actionItems; } #region Control Proxy Properties public string Email { get { return WebControl.Email; } set { SetProperty( "Email" , value ); } } public int Age { get{return WebControl.Age;} set{SetProperty( "Age" , value );} } public DateTime Date { get{return WebControl.Date; } set{SetProperty( "Date" , value ); } } public CityList City { get{return WebControl.City;} set{SetProperty( "City" , value );} } public void ClearValues() { SetProperty( "Email" , string.Empty ); SetProperty( "Age" , -1 ); SetProperty( "City" , CityList.Tel_Aviv ); SetProperty( "Date" , DateTime.Now ); } #endregion private UserInfo WebControl { get { return (UserInfo)this.Component; } } private string GetCategory( object source , string propertyName ) { PropertyInfo property = source.GetType().GetProperty( propertyName ); CategoryAttribute attribute = (CategoryAttribute)property.GetCustomAttributes( typeof( CategoryAttribute ) , false )[ 0 ]; if ( attribute == null ) return null; return attribute.Category; } private string GetDescription( object source , string propertyName ) { PropertyInfo property = source.GetType().GetProperty( propertyName ); DescriptionAttribute attribute = (DescriptionAttribute)property.GetCustomAttributes( typeof( DescriptionAttribute ) , false )[ 0 ]; if ( attribute == null ) return null; return attribute.Description; } // Helper method to safely set a component’s property private void SetProperty( string propertyName , object value ) { // Get property PropertyDescriptor property = TypeDescriptor.GetProperties( this.WebControl )[ propertyName ]; // Set property value property.SetValue( this.WebControl , value ); } } public enum CityList { Tel_Aviv, Ramat_Gan } }
User info with Action List !!!!
-
My Favorites extensions for Firefox
-
äëúáåú äàçøåðåú ù÷øàúé áæîï äàçøåï
בזמן האחרון קראתי הרבה כתבות מענינות, בעיקר בתחום ה-ASP.NET :
-
Efficient Data Paging with the ASP.NET 2.0 DataList Control and ObjectDataSource
Take look on ScottGu's Blog
-
ProfileView
Joshua Flanagan has recently published his ProfileView control, Very Nice Control
-
Quickly Opening a Visual Studio Website Project
Nice tool by Scott
-
Create your own custom Profile base class
-
ASP.NET Compiler Utility Updated
Nice tool by Rick Strahl's
-
Tips for Nested Master Pages and VS 2005 Design-Time
Nice solution by ScottGu's Blog
-
SessionSaver .2 - Firefox Extension
SessionSaver restores your browser -exactly- as you left it, every startup, every time. Not even a crash will phase it. Windows, tabs, even things you were typing -- they're all saved
Click Here -
New Automation Samples for Visual Studio .NET 2005
http://www.microsoft.com/downloads/details.aspx?FamilyId=79C7E038-8768-4E1E-87AE-5BBBE3886DE8&displaylang=en
These code samples show you how to build VSMacros projects, add–ins, and wizards to make your teams more productive and customize Visual Studio .NET 2005 to the ways you like to work. Look for more samples, as well as some white papers and overview documents, in the future.
All of these samples use the Visual Studio automation model, which is free and publicly distributed with Visual Studio .NET 2005. With this automation model, you can do the following:
- Intercept commands when they are invoked, and either provide preprocessing or implement the command yourself.
- Control the solution, projects, and project items by adding or removing them.
- Control the build configurations mechanisms and hook various build events.
- Control a large portion of the text editor.
- Implement commands that help you debug with the debugger objects.
- Control the Windows Forms Designer.
- Create tool windows that behave just like the built-in tool windows for docking and floating.
- Provide content to the Property Browser when items are selected in tool windows.
- Control several of the built-in tool windows (including Task List, Toolbox, Command Window, and Output Window).
- And more...
-
מאיפו הידע?
מדי פעם שואלים אותי מאיפו הידע הרב?
התשובה שלי תמיד אותה תשובה:
לקורא כל יום מאמר אחד, בסוף השנה תיהיו מקצוענים" -
VS2005 Designer Issue - WinForms not opening after migrating
You can find help in Rupreet's Weblog, and Here.
-
My VSTO PowerPoint and Web Cast
1. Ready to Lanuch (12.12.2005 ) - Building Real Smart Applications using Visual Studio Tools for Office 2005
2. My Web Cast - VSTO 2005 -
Visual Studio Hacks
Very nice site for Add-in to VS.NET 2005 - http://www.visualstudiohacks.com/