Practical Issue:
I am building an asp.net 2.0 application using vb.net and I would like to restrict the input of a series of textboxes to a numerical input of no more than two decimal places - any idea how to go about it? I think it might be possible with javascript but I'm a little rusty, anyone know how to do it?
My Suggestion:
You can do it very easly and effectivly using AJAX Tool kit MaskedEdit or FilteredTextBox. Please check the following links :
http://ajax.asp.net/ajaxtoolkit/MaskedEdit/MaskedEdit.aspx
http://ajax.asp.net/ajaxtoolkit/FilteredTextBox/FilteredTextBox.aspx
You can do this by just adding the ajax controls to your project. If you are new to AJAX, please follow these links :
http://ajax.asp.net
http://ajax.asp.net/ajaxtoolkit
There are good tutorials available to start. Any way it worth to use AJAX Tool kits, as you are using ASP.net 2.0.
Tuesday, February 12, 2008
Installing combined skin/container on DotNetNuke (DNN) site.
Common Issue:
Installing combined skin/container on DNN site. I have been thrown by this. Normally i would upload the skins and containers separately. The package has come to me with the instructions to install as a skin package. Please can you tell me the steps to do this as i can't find information anyway on this.
Solution:
I think you are familiar with the Skin/Container Installation. Then, if you are talking about combined Skin/Container as a ZIP file, I guess, that will contain both Skin and Container files seperate zip files. You can unzip and proceed like normal installation.
************************************************
Skin/Container Installation
************************************************
TO INSTALL THE SKIN AND CONTAINERS:
1. Log onto your DotNetNuke 2.X web site as Admin (If Admin can upload skins/containers) or Host
2. Go to Admin -> File Manager
3. Hover over the pencil icon and select "Upload Files"
4. Click on the ( ) Skin option
5. Browse to the [skin zip file name] file in the \SKIN folder.
6. Add it to the upload list
7. Click on UPLOAD.
8. Go to Admin -> File Manager
9. Hover over the pencil icon and select "Upload Files"
10. Click on the ( ) Container option
11. Browse to the [container zip file name] file in the \CONTAINER folder.
12. Add it to the upload list
13. Click on UPLOAD.
APPLY THE SKIN:
1. Add a Tab
2. Click on "Edit" on the Admin bar
3. Select "[skin name - page name]" from the list of available skins.
4. Click on "Update"
APPLY THE CONTAINER:
1. Add a module
2. Hover over the pencil icon for the module and select "Module Settings"
3. Select "[container name - page name]" from the list of available containers.
4. Click on "Update"
* Note: Skin can be applied in host settings or admin settings for entire portal(s) as default and then can be overriden at the tab level.
Installing combined skin/container on DNN site. I have been thrown by this. Normally i would upload the skins and containers separately. The package has come to me with the instructions to install as a skin package. Please can you tell me the steps to do this as i can't find information anyway on this.
Solution:
I think you are familiar with the Skin/Container Installation. Then, if you are talking about combined Skin/Container as a ZIP file, I guess, that will contain both Skin and Container files seperate zip files. You can unzip and proceed like normal installation.
************************************************
Skin/Container Installation
************************************************
TO INSTALL THE SKIN AND CONTAINERS:
1. Log onto your DotNetNuke 2.X web site as Admin (If Admin can upload skins/containers) or Host
2. Go to Admin -> File Manager
3. Hover over the pencil icon and select "Upload Files"
4. Click on the ( ) Skin option
5. Browse to the [skin zip file name] file in the \SKIN folder.
6. Add it to the upload list
7. Click on UPLOAD.
8. Go to Admin -> File Manager
9. Hover over the pencil icon and select "Upload Files"
10. Click on the ( ) Container option
11. Browse to the [container zip file name] file in the \CONTAINER folder.
12. Add it to the upload list
13. Click on UPLOAD.
APPLY THE SKIN:
1. Add a Tab
2. Click on "Edit" on the Admin bar
3. Select "[skin name - page name]" from the list of available skins.
4. Click on "Update"
APPLY THE CONTAINER:
1. Add a module
2. Hover over the pencil icon for the module and select "Module Settings"
3. Select "[container name - page name]" from the list of available containers.
4. Click on "Update"
* Note: Skin can be applied in host settings or admin settings for entire portal(s) as default and then can be overriden at the tab level.
DotNetNuke (DNN) - How to change "Terms of Use" and Privacy Statement and Sitemap
To edit the Privacy and Terms in DNN:
1) Go to: Host / Languages
2) Click on Language Editor
3) You will be presented with a list of templates you can edit
4) Scroll down, select
5) MESSAGE_PORTAL_PRIVACY.Text
6) MESSAGE_PORTAL_TERMS.Text
7) If you click on the arrow to the right hand side of the text box, it will open up the Text Editor so that you can make any alterations necessary.
1) Go to: Host / Languages
2) Click on Language Editor
3) You will be presented with a list of templates you can edit
4) Scroll down, select
5) MESSAGE_PORTAL_PRIVACY.Text
6) MESSAGE_PORTAL_TERMS.Text
7) If you click on the arrow to the right hand side of the text box, it will open up the Text Editor so that you can make any alterations necessary.
Adding a Calendar ( a java script calendar) to ASP.net 2.0 : AJAX Calendar
Real life Issue:
I wants to add javascrip calendar control to my form. [ pop up ] I already add . CSS and .JS fie in to slution explorer. Don't know how to call...through text box
Best Solution:
visit : http://ajax.asp.net/ajaxtoolkit/Calendar/Calendar.aspx to know, how good the AJAX Control Toolkit is. Then the main thing is, you dont have to write a single line of code. You just download the ajax extentions and tool kit from the http://ajax.asp.net site and install it. Follow the simple tutorials. You just visit http://ajax.asp.net wesite to learn ajax. Using ajax controls are smilar to any other control in asp.net (that is like buttons or text boxes... You can drag and drop and configure it to associate with a particular control, by just specifying the controls id in property). Anyway, it is worth to know AJAX while using ASP.net 2.0.
I wants to add javascrip calendar control to my form. [ pop up ] I already add . CSS and .JS fie in to slution explorer. Don't know how to call...through text box
Best Solution:
visit : http://ajax.asp.net/ajaxtoolkit/Calendar/Calendar.aspx to know, how good the AJAX Control Toolkit is. Then the main thing is, you dont have to write a single line of code. You just download the ajax extentions and tool kit from the http://ajax.asp.net site and install it. Follow the simple tutorials. You just visit http://ajax.asp.net wesite to learn ajax. Using ajax controls are smilar to any other control in asp.net (that is like buttons or text boxes... You can drag and drop and configure it to associate with a particular control, by just specifying the controls id in property). Anyway, it is worth to know AJAX while using ASP.net 2.0.
Create typed dataset from xml schema
Practical Issue:
I have a class library project and have added a simple xml schema file.
Here are my questions:
How do you create the dataset from the xml schema file? Do I have to use the xsd.exe from the command line to create the dataset or is there a method to create the dataset from inside the VS 2005 IDE?
My Guidence:
http://aspnet.4guysfromrolla.com/articles/052902-1.aspx
Introduction:
With classic ASP, if one wanted to display XML data on an ASP Web page they had a number of options. The simplest option, in my opinion, would be to use the XML support present in ADO 2.5 to populate a Recordset with XML data, and then to display the Recordset data as you would on any other page. Another option would be to use the MSXML component to iterate through the contents of the XML document, perhaps using XSLT. Similarly, if you wanted to write a collection of data, such as database results, to an XML stream would be, again, to use the Recordset object or to use the MSXML component.
I have a class library project and have added a simple xml schema file.
Here are my questions:
How do you create the dataset from the xml schema file? Do I have to use the xsd.exe from the command line to create the dataset or is there a method to create the dataset from inside the VS 2005 IDE?
My Guidence:
http://aspnet.4guysfromrolla.com/articles/052902-1.aspx
Introduction:
With classic ASP, if one wanted to display XML data on an ASP Web page they had a number of options. The simplest option, in my opinion, would be to use the XML support present in ADO 2.5 to populate a Recordset with XML data, and then to display the Recordset data as you would on any other page. Another option would be to use the MSXML component to iterate through the contents of the XML document, perhaps using XSLT. Similarly, if you wanted to write a collection of data, such as database results, to an XML stream would be, again, to use the Recordset object or to use the MSXML component.
Dynamic SQL Connection String : string.Format and Multiple Connectionstrings in Web.config
Common Issue:
There may be a need of dynamic connection string for a webapplication. There are two solutions I have successfully implemanted. One is String Formatting macro replacement and another one is keeping multiple connection strins in web.config file.
Tips and Tricks:
Following are two example solutions:
1. A macro replacement:
< add connectionstring="Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}" name="ClientConnection" >
Use string.Format to transform the connection string:
string connectionString = string.Format(ConfigurationManager.ConnectionStrings["ClientConnection"].ConnectionString, serverName, databaseName, userId, password);
2. Multiple connection strings, based on database name:
<add connectionstring="Data Source=DBServer1;Initial Catalog=Pepsi;Persist Security Info=True;Trusted_Connection=yes" name="Database1">
<add connectionstring="Data Source=DBServer2;Initial Catalog=Coke;Persist Security Info=True;Trusted_Connection=yes" name="Database2">
string connectionString = ConfigurationManager.ConnectionStrings[DatabaseName].ConnectionString;
Best Practce:
Always use common connection string in one place, either it in Web.config or anyother suitable place, but practice to avoid duplication.
There may be a need of dynamic connection string for a webapplication. There are two solutions I have successfully implemanted. One is String Formatting macro replacement and another one is keeping multiple connection strins in web.config file.
Tips and Tricks:
Following are two example solutions:
1. A macro replacement:
< add connectionstring="Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}" name="ClientConnection" >
Use string.Format to transform the connection string:
string connectionString = string.Format(ConfigurationManager.ConnectionStrings["ClientConnection"].ConnectionString, serverName, databaseName, userId, password);
2. Multiple connection strings, based on database name:
<add connectionstring="Data Source=DBServer1;Initial Catalog=Pepsi;Persist Security Info=True;Trusted_Connection=yes" name="Database1">
<add connectionstring="Data Source=DBServer2;Initial Catalog=Coke;Persist Security Info=True;Trusted_Connection=yes" name="Database2">
string connectionString = ConfigurationManager.ConnectionStrings[DatabaseName].ConnectionString;
Best Practce:
Always use common connection string in one place, either it in Web.config or anyother suitable place, but practice to avoid duplication.
Monday, February 11, 2008
ASP.NET Life Cycle
1. Object Initialization
2. Load Viewstate Data
3. LoadPostData Processes Postback Data
4. Object Load
5. Raise PostBack Change Events
6. Process Client-Side PostBack Event
7. Prerender the Objects
8. ViewState Saved
9. Render To HTML
10. Disposal
2. Load Viewstate Data
3. LoadPostData Processes Postback Data
4. Object Load
5. Raise PostBack Change Events
6. Process Client-Side PostBack Event
7. Prerender the Objects
8. ViewState Saved
9. Render To HTML
10. Disposal
Subscribe to:
Comments (Atom)