Who is online? 161 guests and 0 members
Member login | Become a member
CodeAsp.Net's ASP.NET Blogs is more than just a social community for ASP.NET bloggers - we are one of the largest ASP.NET blog directories on the internet. Whether you are looking to search ASP.NET blogs, connect with ASP.NET bloggers, learn more about ASP.NET, or promote your own blog, CodeAsp.Net is for you. Be sure to check back often as we add new ASP.NET blog postings frequently.
With ASP.NET MVC 3 to be out soon, there are still many developers confused on whether to use MVC or the standard Web Forms UI while building their own custom ASP.NET web applications. I know this has been debated numerous times in the past but let me write on this topic in brief. It would be best to understand this excerpt from the man who created the ASP.NET platform , the great Scott Guthrie : a) Web Forms and MVC are two approaches for building ASP.NET apps. They are both good choices. Each ...
Read More
Here is some quick code to convert an integer to an enum in C#: Assume we have an enum UserInfoDisplayField Method 1: UserInfoDisplayField myEnum=(UserInfoDisplayFieldType)Enum.ToObject(typeof(UserInfoDisplayFieldType),1)); Method 2: UserInfoDisplayField myEnum=(UserInfoDisplayFieldType)1; You can also check the existence of the enum value before conversion using the Enum.IsDefined field.
Run ASP.NET 2.0 and 3.5 applications on the same server Yes, you can run both together, infact the 3.5 applications use the 2.0 compiler. Why? Because version 3.5 is just a wrapper around 2.0 with some additional assemblies. But the newer 4.0 version is a completely new version, and will not be compatible with older versions. That is you cannot compile 3.5 or 2.0 code using 4.0 compiler, IIS will treat them differently too.
How to call C# code within ASPX page Many times we might need to call the C# or VB.NET code from within the ASPX page instead of using a code-behind file. Here is a quick code snippet to do the same: <%@ Page Language= "C#" %> <script runat= "server" > void Page_Load(object sender, EventArgs e) { MyLabelControl.Text = "time is " + DateTime.Now.ToString(); } //now a button click event handler void Button1_Click(Object sender, EventArgs e) { MyLabelControl.Text = "Clicked at " + DateTi...
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Microsoft has been made aware of an issue with a McAfee DAT file update - released Wednesday, April 21, 2010 - that has been causing stability issues on Windows XP client systems. The symptom is caused by a false-positive detection on a core Windows file (svchost.exe). Once the file is quarantined by McAfee, the system may encounter one of the following symptoms: · The computer shuts down when a DCOM error or a RPC error o...
Microsoft has a wonderful tool which can easily be installed on your server and gives you detailed reports on SEO-bility of your website, specifically: 1. you can run multiple reports to find out if your site has any major SEO issues. 2. not only does the toolkit identifies SEO issues, but also helps you fix them too. 3. it will index all reachable links on your website and provide detailed link-link analysis. You just need to simply install this toolkit on the webserver where your site is runni...
Suppose you are running your ASP.NET application on a domain like http://www.mydomain.com, and you want to access this domain (www.mydomain.com) in your code. The below method can be used to get the host name: string host= HttpContext.Current.Request.Url.Host; One problem with this is that it will not get port number. For detailed explanation and other possible solutions, refer this link for details: http://forums.asp.net/t/1187298.aspx Here is another solution which handles port number too. htt...
In one of our products, Communifire, we were dealing with a rather "silly" issue related to persistence of cookies in IE 8. We had created a new easy to implement Single Sign On (SSO) feature which lets users share authentication across parent domain and sub-domain (assuming CF is running on a sub-domain whereas users login via the parent website hosted on the TLD). We were creating a new cookie when user logs in via parent domain and then CF would pick that cookie up and auto-login the user usi...
While using Fiddler to examine HTTP traffic on your localhost, you may get this error: Fiddler: No connection could be made because the target machine actively refused it This happens because by default .NET bypasses local proxies while sending requests and Fiddler runs as a proxy. One way to catch local HTTP traffic is to change the URL in the browser by appending a "dot" to it (after the localhost), for example: http://localhost:3720/login.aspx becomes, http://localhost.:3720/login.aspx If thi...
I noticed a developer encoding an already RSA encrypted byte array to a string format, so that he can save it in database. He was using this code: byte[] message = Encoding.UTF8.GetBytes("string to be encrypted"); byte[] encrypted = rsaAlgo.PrivateEncryption(message); string save_in_db = Encoding.UTF8.GetString(encrypted); Then he simply wanted to decrypt save_in_db to its original value, using the following code: byte[] message = Encoding.UTF8.GetBytes(save_in_db); byte[] decrypted = myRsa.Publ...
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address: