Category Archives: ASP.NET & C#

This category has articles regarding asp and asp.net

ASP.NET – Create web chart in your web application

if you want to load chart in your asp.net web application , you can try Microsoft Office Web Components. http://msdn.microsoft.com/en-us/library/aa198515%28office.10%29.aspx If you want simple web chart and totally based on dotnet library then use this demo project. Its also simple and nice. http://www.codeproject.com/KB/custom-controls/webchart.aspx Main thing is that both are free , so enjoy web charts.

Validation of viewstate MAC failed

I had many user controls with datagrid in one page, which worked in my local work station but it suddenly raise below error on production server after deployment. Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. [...]

javascript value in server side variable

You can get variable from javascript and use it in code behind code in dotnet variable it means server side variable. Dim strMessage2 As String = “” Response.Write(“var str1 = prompt(‘Please Enter Password:’,”);”) strMessage2 = “document.write(str1);” Response.Write(strMessage2)

Calling postback event from Javascript

SOURCE : http://www.dotnetspider.com/resources/1521-How-call-Postback-from-Javascript.aspx Introduction Postback is a concept introduced in ASP.NET and is a very handy method. Postback is built into the ASP.NET and most of the web controls support it without writing any code. Calling postback event from Javascript There may be some scenario where you may want to explicitly postback to the server [...]

Data Type Mapping

Mapping data types into different environments like .Net and SQL server. ASP.NET Control DNN KickStart Field type .NET Framework SQL Server ADO DataType Enum ADO DataType Enum Value Size Access Oracle Visual Basic 6.0 Int64 SqlDbType.BigInt OleDbType.BigInt bigint adBigInt 20 8 Variant Byte[] SqlDbType.VarBinary OleDbType.Binary binary timestamp adBinary 128 50 8 Raw Variant Yes/No Boolean [...]

Format data in asp.net using BoundColumn.DataFormatString Property

Syntax   Inline <asp:boundcolumn dataformatstring = strFormat … > Script BoundColumn.DataFormatString = strFormat   Property Value   strFormat A formatting string that specifies the display format of data in the column. The property is read/write with no default value. Remarks Use the DataFormatString property to specify the display format for data in the column. The [...]

How to: Access SQL Server Using Windows Integrated Security

©2008 Microsoft Corporation. All rights reserved. ASP.NET How to: Access SQL Server Using Windows Integrated Security  http://msdn2.microsoft.com/en-us/library/72wdk8cc(printer).aspx If your application runs on a Windows-based intranet, you might be able to use Windows integrated authentication for database access. Integrated security uses the current Windows identity established on the operating system thread to access the SQL Server [...]

prevent you from having to POSTBACK to the server to access validator’s properties.

Source : http://forums.asp.net/p/839953/840084.aspx This example shows how to validate the LastName textbox but only if the FirstName textbox contains a value. The first part is simply HTML tags with the form controls, the second part is simply the code for “onblur” even in the Page_Load event handler. FIRST HTML ***************************************************************************** <%@ Page Language=”vb” AutoEventWireup=”false” Codebehind=”WebForm1.aspx.vb” [...]

Difference between RegisterClientScriptBlock and RegisterStartupScript

I will try to explain the difference between RegisterClientScriptBlock and RegisterStartupScript . I have experienced the difference while I was doing some stuffs yesterday. Here is what I was doing. I had a hidden field called txtHiddenField, an update button and some tabs in my page. I also have a javascript function called DisplayTab. function [...]

Good article for performance in asp.net

Hi I got one another code optimization for speed up asp.net application I had one quick view but need to go for detail review to dig it (if i get time in next days tooo )… Go over link for detail study – http://www.sitepoint.com/article/aspnet-performance-tips Empowering Web Developers Since 1997 SitePoint Sponsor Article Home » Server [...]

Follow

Get every new post delivered to your Inbox.