30.1.09
upload valid image Validator
asp:RegularExpressionValidator ID="RegularFile" runat="server" ControlToValidate="ProductImageUpload" Display="Dynamic" ErrorMessage="Upload a valid file" ValidationExpression="^.+(.jpg|.JPG|.gif|.GIF)$" ValidationGroup="image">
radcombo setting in firefox
if (Request.Browser.Type == "Firefox3.0.3")
{
DropDownAccountCard .OffsetX = 2;
ddExpMonth .OffsetX = 2;
ddExpYear.OffsetX = 2;
}
if (Request.Browser.Type == "Desktop")
{
DropDownAccountCard .Width =165;
}
{
DropDownAccountCard .OffsetX = 2;
ddExpMonth .OffsetX = 2;
ddExpYear.OffsetX = 2;
}
if (Request.Browser.Type == "Desktop")
{
DropDownAccountCard .Width =165;
}
custom validator for Radcombo and checkbox
CustomValidator ID="CusAccountcard" runat="server" ClientValidationFunction="Valaccountcard"
ControlToValidate="DropDownAccountCard" Display="Dynamic" ErrorMessage="Please select account card"
ValidationGroup="Save" asp:CustomValidator
function Valaccountcard(sender,args)
{
var combo =<%=DropDownAccountCard.ClientID %>;
if(combo.GetText()!="Select")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}
function Validate(sender,args)
{
var combo =<%=ddExpMonth.ClientID %>;
if(combo.GetText()!="Select")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
var d=new Date();
}
function ValidateYear(sender,args)
{
var combo =<%=ddExpYear.ClientID %>;
if(combo.GetText()!="Select")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}
function ValidationCheck (sender,args)
{
if(document.getElementById('ctl00_Content1_chkAccept').checked==true)
{
args.IsValid=true;
}
else
{
args.IsValid=false;
}
}
ControlToValidate="DropDownAccountCard" Display="Dynamic" ErrorMessage="Please select account card"
ValidationGroup="Save" asp:CustomValidator
function Valaccountcard(sender,args)
{
var combo =<%=DropDownAccountCard.ClientID %>;
if(combo.GetText()!="Select")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}
function Validate(sender,args)
{
var combo =<%=ddExpMonth.ClientID %>;
if(combo.GetText()!="Select")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
var d=new Date();
}
function ValidateYear(sender,args)
{
var combo =<%=ddExpYear.ClientID %>;
if(combo.GetText()!="Select")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}
function ValidationCheck (sender,args)
{
if(document.getElementById('ctl00_Content1_chkAccept').checked==true)
{
args.IsValid=true;
}
else
{
args.IsValid=false;
}
}
29.1.09
difference between value type and reference type
n simple words, all value based types are allocated on the stack, while all reference based types are allocated on the heap. What does this mean? A value type contains the actual value. A reference type contains a reference to the value. When a value type is assigned to another value type, it is copied. When a reference type is assigned to another reference type, a reference is assigned to the value.
By saying stack, we mean things are kept one on top of the other. We keep track of each value at the top. By saying heap, we mean things are kept in a mashed order. We keep track of each value by its address, that is referenced by a pointer to it.
All value types are implicitly derived from System.ValueType. This class actually overrides the implementation in System.Object, the base class for all objects which is a reference type itself.
Data types like integers, floating point numbers, character data, Boolean values, Enumerations and Structures are examples of Value Types. Classes, Strings, Arrays are examples of Reference Types.
A value type may not contain NULL values. Reference types may contain NULL values.
It is not possible to derive new types from Value Types. This is possible in Reference types. However, Value Types like Structures can implement interfaces
By saying stack, we mean things are kept one on top of the other. We keep track of each value at the top. By saying heap, we mean things are kept in a mashed order. We keep track of each value by its address, that is referenced by a pointer to it.
All value types are implicitly derived from System.ValueType. This class actually overrides the implementation in System.Object, the base class for all objects which is a reference type itself.
Data types like integers, floating point numbers, character data, Boolean values, Enumerations and Structures are examples of Value Types. Classes, Strings, Arrays are examples of Reference Types.
A value type may not contain NULL values. Reference types may contain NULL values.
It is not possible to derive new types from Value Types. This is possible in Reference types. However, Value Types like Structures can implement interfaces
Text Scroll with javascript
see this :
http://www.java2s.com/Code/JavaScript/GUI-Components/TextScrollwhenmouseover.htm
http://www.java2s.com/Code/JavaScript/GUI-Components/TextScrollwhenmouseover.htm
26.1.09
22.1.09
URL Rewriting in ASP.NET using URLRewriter.Net
Check this link:
http://www.tutorialsasp.net/tutorials/url-rewriting-in-aspnet-using-urlrewriternet/#comment-811
For asp.net Tutorials:
http://www.tutorialsasp.net/tutorials/
http://www.tutorialsasp.net/tutorials/url-rewriting-in-aspnet-using-urlrewriternet/#comment-811
For asp.net Tutorials:
http://www.tutorialsasp.net/tutorials/
10.1.09
To check if number in text box is numeric c#
int resultValue = 0;
if (int.TryParse(textBox1.Text, out resultValue))
{
// It was an integer in the text box
MessageBox.Show(resultValue.ToString());
}
else
{
{
// It was NOT an integer in the text box
}
}
if (int.TryParse(textBox1.Text, out resultValue))
{
// It was an integer in the text box
MessageBox.Show(resultValue.ToString());
}
else
{
{
// It was NOT an integer in the text box
}
}
8.1.09
Default Edit mode for Grid item
http://www.telerik.com/help/aspnet-ajax/grddefaulteditmodeforgriditemsoninitialload.html
3.1.09
Try Catch in Asp.net Code
try
{
if (!Page.IsPostBack)
{
bindCategories();
}
}
catch (Exception)
{
Response.Redirect("error.aspx");
}
{
if (!Page.IsPostBack)
{
bindCategories();
}
}
catch (Exception)
{
Response.Redirect("error.aspx");
}
Subscribe to:
Posts (Atom)