http://odetocode.com/Blogs/scott/archive/2012/08/25/asp-net-mvc-highlight-current-link.aspx
Wednesday, August 29, 2012
Monday, August 27, 2012
Thursday, August 23, 2012
Tuesday, August 21, 2012
Friday, August 17, 2012
Thursday, August 16, 2012
Visual Studio 2012 and .NET Framework 4.5 is RELEASED
http://www.hanselman.com/blog/VisualStudio2012AndNETFramework45IsRELEASEDHeres5MinuteVideosToGetYouUpToSpeedQuick.aspx
Wednesday, August 15, 2012
Filtering Data in ASP.NET MVC using jQuery and Partial Views
http://www.devcurry.com/2012/08/filtering-data-in-aspnet-mvc-using.html
Tuesday, August 14, 2012
Monday, August 13, 2012
How to store a dictionary object in web.config?
<configuration>
<configSections>
<section
name="MyDictionary" type="System.Configuration.NameValueFileSectionHandler,System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<MyDictionary>
<add key="name1" value="value1" />
<add key="name2" value="value2" />
</MyDictionary>
</configuration>
NameValueCollection section = (NameValueCollection)ConfigurationManager.GetSection("MyDictionary");
<configSections>
<section
name="MyDictionary" type="System.Configuration.NameValueFileSectionHandler,System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<MyDictionary>
<add key="name1" value="value1" />
<add key="name2" value="value2" />
</MyDictionary>
</configuration>
NameValueCollection section = (NameValueCollection)ConfigurationManager.GetSection("MyDictionary");
Publishing Improvements, chained Config Transforms and Deploying ASP.NET Apps from the Command Line
http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
msbuild MySolution.sln /p:DeployOnBuild=true;PublishProfile=%1;AllowUntrustedCertificate=true;Password=poo
msbuild MySolution.sln /p:DeployOnBuild=true;PublishProfile=%1;AllowUntrustedCertificate=true;Password=poo
Validate Image Type Using Image GUID in ASP.NET
http://www.codeproject.com/Tips/409328/Validate-Image-Type-Using-Image-GUID-in-ASP-NET
System.Drawing.Image image = System.Drawing.Image.FromStream(FileUpload1.FileContent);
string FormetType = string.Empty;
if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Tiff.Guid)
FormetType = "TIFF";
else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Gif.Guid)
FormetType = "GIF";
else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Jpeg.Guid)
FormetType = "JPG";
else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Bmp.Guid)
FormetType = "BMP";
else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Png.Guid)
FormetType = "PNG";
else if (image.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Icon.Guid)
FormetType = "ICO";
else
Thursday, August 9, 2012
How to add http header into ASP.NET development server, Cassini, to change document mode in IE?
Add following line in Global.asax
protected void Application_BeginRequest() {
HttpContext.Current.Response.AddHeader("X-UA-Compatible", "IE=edge");
}
protected void Application_BeginRequest() {
HttpContext.Current.Response.AddHeader("X-UA-Compatible", "IE=edge");
}
Wednesday, August 8, 2012
Tuesday, August 7, 2012
Handling Exceptions and 404 Errors in ASP.NET MVC
1. Add Customer error section in web.config file
2. Log exception in Application_Error event handler
2. Log exception in Application_Error event handler
void Application_Error(object sender, EventArgs e) { try { //Get the Error. Exception ex = Server.GetLastError(); Response.Redirect("~/YourErrorPage"); } catch { //Response.Redirect("/oops.aspx"); } }
Friday, August 3, 2012
Thursday, August 2, 2012
Wednesday, August 1, 2012
How to select unique class list by one property in LINQ? like DISTINCT in TSQL
classList.GroupBy(prop => prop.Id).Select(group => group.FirstOrDefault()).ToList()
http://rayaspnet.blogspot.ca/2011/08/how-to-implement-sql-distinct-keyword.html
http://rayaspnet.blogspot.ca/2011/08/how-to-implement-sql-distinct-keyword.html
Remote debugging in Visual Studio
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger
http://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx
http://msdn.microsoft.com/en-us/library/y7f5zaaa.aspx
Subscribe to:
Posts (Atom)