Skip to main content

ASP.NET

Go Search
Home
TFS2005
TFS2008
ASP.NET
GRIDVIEW
WCF
MSSQL
SilverLight
JAVA
Flex
JQuery
Powershell
  

> ASP.NET

 <connectionstrings> Encrypt/Decrypt

C:\>CD C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>
C:\>aspnet_regiis.exe -pef "connectionStrings" C:\projects\venky\WebConfigEncryptDecrypt -prov "DataProtectionConfigurationProvider"
 
Some userful secure methods to consme in your .Net applications

private bool IsConnectionStringsProtected(string sectionName)
{
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection(sectionName);
if ((section != null) & (section.SectionInformation.IsProtected))
{ return true;} else {return false;}
}

private void ProtectConfiguration(string sectionName, string provider)
{
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection(sectionName);
if ((section != null) & (!section.SectionInformation.IsProtected))
{
section.SectionInformation.ProtectSection(provider);
config.Save();
}
}
private void UnProtectConfiguration(string sectionName)
{Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section = config.GetSection(sectionName);
if ((section != null) & (section.SectionInformation.IsProtected))
{
section.SectionInformation.UnprotectSection();
config.Save();
}
}

To protect connectionstrings section:
ProtectConfiguration("connectionStrings", "DataProtectionConfigurationProvider");
To protect identity sub section:
ProtectConfiguration("system.web/identity", "DataProtectionConfigurationProvider");
To unprotect connectionstrings section:
UnProtectConfiguration("connectionStrings");
To unprotect identity sub section:
UnProtectConfiguration(
"system.web/identity");  

 Announcements

There are currently no active announcements.

 Calendar

There are currently no upcoming events.
 
 

 DATA Performance

  DataReaders, DataSets, and performance

 Data Binding in ASP.NET

Two way binding (very popular)

<%
   1: # Bind("fieldname") 
%>
 
One way Binding (ReadOnly)
<%
   1: # Eval("fieldname") 
%>

Another one is :

<%
   1: # DataBinder.Eval(Container.DataItem, "fieldname") 
%>

when we have a textbox inside a TemplateField, follow below Syntax:

<TemplateField>
<EditItemTemplate>
<asp:TextBox id="txtName" runat="server" Text='<%# Bind("Name") %>' />
</EditItemTemplate>
</TemplateField>

 Links

  Impellium Software
  Five Things You Didn't Know JavaScript Could Do
  Building datagrid with Add/Edit
  serializationexception
  ASP.NET site navigation
  Read using DataReader object
  ASPNETVersionSwitcher
  Using C# 3.0 Anonymous Types as Dictionaries
  ASP.NET Menu Walkthru
  ASP.NET 2.0 CSS Friendly Control Adapters 1.0
  TDD with asp.net
  Test Driven Development with ASP.NET MVC
  shopping cart
  String Handling and Regular Expressions
  Adding communication between-user-controls-without-involving-the-web-form
  Communication between User controls
  ASP.NET User Controls - Notify One Control Of Changes In Other Control
  Page and User Control communication
  communication bet 2 uc's
  Global.ascx session start end
(More Links...)