Thursday, October 20, 2011

Client side Validation on submit with javascript and aspxtextbox

DevExpress controls own validation mechanism. Specify textbox validation group property under validationsettings to string value that you want to use and specify in the ValidationGroup method as parameter.

you can raise validation check from client side event of any button using devepress client side framework as:

OnClientClick="return ASPxClientEdit.ValidateGroup('validationgroupname');

Here is the code snippet to explain:

User Name:
<dxe:ASPxTextBox ID="tbUserName" runat="server" Width="170px">
<ValidationSettings SetFocusOnError="True">
<RequiredField IsRequired="True" ErrorText="User name can't be empty" />
</ValidationSettings>
</dxe:ASPxTextBox>
Password:
<dxe:ASPxTextBox ID="tbPassword" runat="server" Width="170px" Password="True">
<ValidationSettings SetFocusOnError="True">
<RequiredField IsRequired="True" ErrorText="Password can't be empty"
ValidationGroup="MYGroup"/>
</ValidationSettings>
</dxe:ASPxTextBox>
Last Name:
<dxe:ASPxTextBox ID="tbLastName" runat="server" Width="170px">
<ValidationSettings SetFocusOnError="True">
<RequiredField IsRequired="True" ErrorText="Last name can't be empty" />
</ValidationSettings>
</dxe:ASPxTextBox>
First Name:
<dxe:ASPxTextBox ID="tbFirstName" runat="server" Width="170px">
<ValidationSettings SetFocusOnError="True">
<RequiredField IsRequired="True" ErrorText="First name can't be empty" />
</ValidationSettings>
</dxe:ASPxTextBox>
<br />
<asp:Button ID="btnSumbit" runat="server" Text="Submit" OnClientClick="return
ASPxClientEdit.ValidateGroup('MYGroup');" />

Now it will validate on tbPassword. no others because they do not match validationgroup.

Get JavaScript IntelliSense With DevExpress Client-Side Objects

Add IntelliSense Support

Follow these 3 easy steps to add IntelliSense support to your project:

1. Install the latest DXperience v2010.1 release. (Currently, the DXperience v2010.1 beta is available to DXperience subscription license holders).

2. Click the ‘Add Existing Item’ in your project menu. Then add the ASPxScriptIntelliSense.js file to your project which should be located in the following folder:

%DevExpress Install Folder %\DevExpress 2011.1\ Components\ Sources\ DevExpress.Web.ASPxScriptIntellisense\ASPxScriptIntelliSense.js

For example, on my local machine the ASPxScriptIntelliSense.js file is located here:

C:\Program Files\DevExpress 2011.1\ Components\ Sources\ DevExpress.Web.ASPxScriptIntellisense\ASPxScriptIntellisense.js

3. Type the following code in the page <body> section in the page when using MVC that you want to enable JavaScript IntelliSense:
<% if (DesignMode){ %>
<script src="../ASPxScriptIntelliSense.js" type="text/javascript"></script>
<% } %>


Note: It's important to check the “if(DesignMode)” statement because it helps to avoid additional round trips to the server for the ASPxScriptIntelliSense.js file. It also helps to prevent mixing up the IntelliSense schema classes and production scripts classes.

On simple aspx pages just add this js using src attribute of <script> tag as:

<script src="/js/ASPxScriptIntelliSense.js" type="text/javascript"></script>

That's it - you now have full IntelliSense support for DevExpress client controls in BLOCKED SCRIPT



New Cast Methods

We’ve also added special static Cast methods which enable you to cast the DevExpress control's client object and then get the client object’s properties, methods and events via IntelliSense.

(e.g. ASPxClientButton.Cast(obj), ASPxClientTreeList.Cast(obj), etc.). You can use these methods with event arguments:

<script type="text/javascript">
function OnGridRowDblClick(s, e) {

var gridInstance = ASPxClientGridView.Cast(s);

gridInstance.StartEditRow(gridInstance.GetFocusedRowIndex());
}
</script>

These new cast methods also accept the ClientInstanceName of the client object. Therefore, to get a client object with IntelliSense support, simply pass the ClientInstanceName as a string to the Cast method:

<form id="form1" runat="server">

<script type="text/javascript">
function OnGridRowClick(s, e) {
var gridInstance = ASPxClientGridView.Cast("grid");
}
</script>

<div>
<dx:ASPxGridView ID="ASPxGridView1" runat="server" ClientInstanceName="grid">
<ClientSideEvents Init="OnGridRowClick" />
</dx:ASPxGridView>
</div>
</form>
Cast Sender Object
You also get JavaScript IntelliSense for the gridInstance variable. For example, this method shows how you can cast the sender object and get JavaScript IntelliSense:

Fig.1:



Fig.2:



there is great article by Mehul at DevExpress Blog….
Happy Coding.

Calling a web method that defined in user control

Scenario:
I have an usercontrol on my page and I want to call a webmethod using jquery ajax on usercontrol’s button click. I got that call is not able to get the specified url in the ajax request.

Reason:
You can't call a page method declared within an ASCX user control.

Solutions:
1. You should use an ASMX web service.  They are almost exactly the same as a page method, both when writing them and when consuming them.

2. Create method on user control containing page and do work on the data passed through json. 

UserControlContainingPage:

namespace Demo{
public partial class UserControlContainingPage: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod(EnableSession = true)]
public static string Control_GetTest()
{
return Control.GetTest();
}
}}

MyUserControl.ascx.cs

namespace Demo{
public partial class MyUserControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
HttpContext.Current.Session["test"] = DateTime.Now.ToString();
}
// ALMOST A WEB METHOD
public static string GetTest()
{
return " is " + HttpContext.Current.Session["test"];
}
}}

Control.ascx

<script type="text/javascript">   
var dataSend = {};
$.ajax({
type: "POST",
url: "UserControlContainingPage.aspx/Control_GetTest",
data: dataSend,
cache: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function(data) {
alert("before");
},
success: function(data) {
alert("Page Load Time from Session " + data.d);
},
fail: function() {
alert("fail");
}
}); </script>

So you have one ASPX which acts basically like a Interface for all AJAX Methods in all your Web Controls.

Wednesday, October 19, 2011

Passing JSON parameters through jQuery

If you’re sending data in your request, use jQuery’s contentType parameter to set the content-type, so that the default is never added:

$.ajax({
type: "POST",
url: "WebService.asmx/WebMethodName",
data: "{'fname':’developer’, 'lname':’rocks’}",
contentType: "application/json; charset=utf-8",
dataType: "json"
});

ASP.NET AJAX script services and page methods understand and expect input parameters to be serialized as JSON strings. These parameters are parsed out of the POST data and used as arguments to the method you’ve called.

However, if you directly provide a JSON object as the data parameter for an $.ajax call, jQuery will attempt to URL encode the object instead of passing it on to your web service.

Take this sample request, for example:

$.ajax({
type: "POST",
url: "WebService.asmx/WebMethodName",
data: {'fname':’developer’, 'lname':’rocks’},
contentType: "application/json; charset=utf-8",
dataType: "json"
});

Because that data parameter is a valid object literal, calling the web service this way won’t throw any JavaScript errors on the client-side.

You can send it as:

fname=dave&lname=ward

To which, the server will respond with:

Invalid JSON primitive: fname.

This is clearly not what we want to happen. The solution is to make sure that you’re passing jQuery a string for the data parameter, like this:

$.ajax({
type: "POST",
url: "WebService.asmx/WebMethodName",
data: "{'fname':’developer’, 'lname':’rocks’}",
contentType: "application/json; charset=utf-8",
dataType: "json"
});

It’s a small change in syntax, but makes all the difference. Now, jQuery will leave our JSON object alone and pass the entire string to ASP.NET for parsing on the server side.

Taking these three caveats into account, I think this is the best practice for calling read-only ASP.NET AJAX web services via jQuery:

$.ajax({
type: "POST",
url: "ServiceName.asmx/WebMethodName",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Do interesting things here.
}
});

When consuming web services that require parameters, the usage is similar. Just make sure that you’re passing a JSON object in a string:
$.ajax({
type: "POST",
url: "ServiceName.asmx/WebMethodName",
data: "{'fname':’developer’,'lname':’rocks’}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Do magic here.
}
});
In either of these cases, substitute PageName.aspx for ServiceName.asmx and PageMethodName for WebMethodName if you want to call a page method instead of a web service.

Web User Controls - Creating and using on webpages

Web user controls combine one or more server or HTML controls on a Web user control page, which can, in turn, be used on a Web form as a single control. User controls make it possible to create a single visual component that uses several controls to perform a specific task.

Once created, user controls can be used on Web forms throughout a project. However, because they are not compiled into assemblies, they have the following limitations not found with other types of controls:

· A copy of the control must exist in each Web application project in which the control is used.

· User controls can’t be loaded in the Visual Studio .NET Toolbox; instead, you must create them by dragging the control from Solution Explorer to the Web form.

· User control code is initialized after the Web form loads, which means that user control property values are not updated until after the Web form’s Load event.

Creating User Controls

There are three steps to creating and using a user control in a Web application
  1. Add a Web user control page (.ascx) to your project.
  2. Draw the visual interface of the control in the designer.
  3. Write code to create the control’s properties, methods, and events.
Creating a User Control and Drawing Its Interface
You create user controls out of other server and HTML controls in the Visual Studio .NET Toolbox. You do this by drawing the controls on a user control page, which is simply another file type in a Web application project, just like a Web form or an HTML page. User controls are identified by their .ascx file extensions.

To create a user control and add it to a Web application, follow these steps:

  1. From the Project menu, choose Add Web User Control. Visual Studio .NET displays the Add New Item dialog box.
  2. Type the name of the user control in the Name box, and click OK. Visual Studio .NET creates a new, blank user control page and adds it to the project, as shown in Figure 1.



Figure 1. A new, blank user control page

After you’ve added a user control page to your project, create the visual interface of the control by adding server or HTML controls to it. User controls support flow layout only, so if you want to position controls on the page using grid layout, add an HTML Grid Layout Panel control to the user control as a container for the controls you want to position. Figure 2 shows a simple user control created by placing two Button server controls on an HTML Grid Layout Panel control.



Figure 2. A simple user control

The control shown in Figure 2 is the Web form’s equivalent of a Spin control. The control allows you to increment or decrement a value by clicking the up or down arrow. This example is used in the sections that follow; the HTML for the user control is shown here for reference:

<div id="pnlGrid" runat="server" style="width: 20px; position: relative; height: 48px
ms_positioning="GridLayout">

<asp:Button ID="butUp" Text="^" runat="server" />
<asp:Button ID="butDown" Text="v" runat="server" />

</div>
</form>

Writing the Control’s Properties, Methods, and Events

You manipulate the controls you add to the user control from the user control’s code module. That allows you to hide the inner workings of the control and expose the tasks the control performs as properties, methods, and events.

To edit the user control’s code module, simply double-click the user control. Visual Studio .NET automatically generates the code template shown in Figure 3 when you create a user control.



Figure 3. The user control code template (Visual Basic .NET)

The code in Figure 3 is similar to the generated code for a Web form, with these notable differences:

  • The user control’s class is based on the System.Web.UI.UserControl base class.

This base class provides the base set of properties and methods you use to create the control and get the control’s design-time settings from its HTML attributes on the Web form.

  • The user control’s Load event occurs when the control is loaded by the Web form that contains it.
  • The control’s Load event procedure runs after the Web form’s Load event procedure, which is important to remember when you work with user controls on a Web form.

To create properties and methods for the user control that you can use from a Web form, follow these steps:
  1. Create the public property or method that you want to make available on the containing Web form.
  2. Write code to respond to events that occur for the controls contained within the user control. These event procedures do the bulk of the work for the user control.
  3. If the property or method needs to retain a setting between page displays, write code to save and restore settings from the control’s ViewState.
  4. For example, the following code shows a Value property that returns the value of the Spin control created in the preceding section:

public int Value
{
get
{
// Return the Value.
return Convert.ToInt32(ViewState["Value"]);
}
set
{
// Set the Value.
ViewState["Value"] = value;
}
}

The user changes the value of the Spin control by clicking the up and down buttons, so the following code increments or decrements the value, depending on which button the user clicks:

private void butDown_Click(object sender, System.EventArgs e)
{
// Decrement the Value.
this.Value -= 1;
}

private void butUp_Click(object sender, System.EventArgs e)
{
// Increment the Value.
this.Value += 1;
}

Adding Events to the User Control

In addition to properties and methods, user controls can provide events that can respond to user actions on the Web form.

To add an event to a user control, follow these steps:

  1. Declare the event within the user control’s code module. For example, the following code declares a Click event for the Spin user control:
// Declare the event.

public event EventHandler Click;

  1. Create a method to raise the event. This step makes it easier for other classes to derive from this class, because they can override this method.
  2. // Method to raise event.

    protected virtual void OnClick(EventArgs e)
    {
    if (Click != null)
    {
    Click(this, e);
    }
    }

  1. Raise the event from within the user control’s code. For example, the following code raises the Click event whenever a user clicks the up or down buttons in the Spin user control:
  2. private void butDown_Click(object sender, System.EventArgs e)
    {
    // Decrement the Value.
    this.Value -= 1;

    // Call the OnClick method.
    OnClick(e);
    }

    private void butUp_Click(object sender, System.EventArgs e)
    {
    // Increment the Value.
    this.Value += 1;
    // Call the OnClick method.
    }
To use the user control event from a Web form, include the user control on a Web form, as shown in the preceding two sections, and then write an event procedure that responds to the event. For example, the following code updates a text box when the user clicks the Spin control:

private void InitializeComponent()

{
// Add this line to wire the event.
this.Spin1.Click += new System.EventHandler(this.Spin1_Click);
}

private void Spin1_Click(object sender, System.EventArgs e)
{
// Display the Spin control's value.
TextBox1.Text = Spin1.Value.ToString();
}

Adding the Control to a Web Form
There are two steps to consume user control in a Web application:

1. Use the control on a Web form by dragging it from Solution Explorer to the Web form on which you want to include it.

2. Use the control from a Web form’s code by declaring the control at the module level and then using the control’s methods, properties, and events as needed within the Web form.

User controls can be dragged directly from Solution Explorer onto a Web form. When you add a user control to a Web form in this way, Visual Studio .NET generates a @Register directive and HTML tags to create the control on the Web form.

For example, the following sample shows the HTML generated when you drag the Spin user control onto a Web form:

<%@ Register TagPrefix="uc1" TagName="Spin" Src="Spin.ascx" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="UserControlDemo.Default" %>
<HTML>
<body>
<form id="Form1" method="post" runat="server">
<uc1:Spin id="Spin1" runat="server" Value="5"></uc1:Spin>
</form>
</body>
</HTML>

User controls can exist alongside and interact with other controls on a Web form. For example, the following HTML shows the Spin user control next to a TextBox control:

<%@ Register TagPrefix="uc1" TagName="Spin" Src="Spin.ascx" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="UserControlDemo.Default" %>

<HTML>
<body>
<form id="Form1" method="post" runat="server">
<h2>Creating and Using User Controls</h2>
<hr>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<uc1:Spin id="Spin1" runat="server" Value="5"></uc1:Spin>
</form>
</body>
</HTML>

Notice that the user control includes an attribute for the Value property. When the Spin control loads at run time, Microsoft ASP.NET will set the control’s properties based on the attributes in the HTML. The control’s attributes provide a way to set the control’s properties from HTML.

When you view the preceding HTML in Visual Studio .NET’s Design mode, it appears as shown in Figure 4.



Figure 4. The Spin user control on a Web form

As you’ll notice in Figure 4, the Web Forms Designer doesn’t display the user control as it will appear at run time. Instead, it shows a sort of generic control. This is a limitation of Visual Studio .NET—it can’t display user controls in Design mode.

Another thing you’ll notice is that the Spin control supports only flow layout on the Web form. That is a limitation of the control itself. To support grid layout and absolute positioning on the Web form, you have to add code to support the style attribute.

Using the Control in Code

After you’ve created a user control and added it to a Web form, you can use it from the Web form’s code module by following these steps:
  1. Declare the user control at the module level. For example, the following line declares the Spin user control that was added to the Web form in the preceding section:

protected Spin Spin1;

  1. Use the control’s properties, methods, and events as you would any other control. For example, the following event procedure displays the Spin control’s value in a text box:
  2. private void Page_PreRender(object sender, System.EventArgs e)
    {
    // Display the Spin control's value.
    TextBox1.Text = Spin1.Value.ToString();
    }
One very important thing to notice here is that the preceding code uses the Web form’s PreRender event, not its Load event. If you use the Load event, you’ll see only the Value set in the user control’s HTML Value attribute the first time you click the Spin control. (Try it!) That’s because the user control’s code doesn’t run until after the Web form’s Load event has finished. Any changes that were saved in the control’s ViewState aren’t loaded until the control’s Load event procedure has run.

Monday, October 17, 2011

ASPxGridView GridViewCommandColumn delete button image at runtime with delete confirmation

 Scenario:
I have aspxGridView with list of items and i want to confirm from user before deletion
of a row/ record.

Solution:
There are two approach to achieve this target. one is
Using the in-built Delete button:  
GridViewCommandColumn.DeleteButton


and another is:
Custom Button that you will create from scratch

What is the XPS Viewer and what it does?

An XPS document is any file that is saved to the XML Paper Specification or .xps file format. Although you can create XPS documents (.xps files) by using any program that you can print from in Windows, you can view XPS documents only by using the XPS Viewer.
When you open an XPS document, the viewer automatically opens the document in an Internet Explorer window. Two additional toolbars appear, one above and the other below, the XPS document. Each toolbar provides options for viewing and managing XPS documents, including:
·         Saving a copy of the XPS document to your computer.
·         Finding a word or phrase in the read-only XPS document.
·         Going to a specific page by typing a page number or by navigating forward and back through the document pages.
·         Zooming in or out to make text and pictures easier to read.
·         Viewing one or more pages at a time on your screen.
·         Digitally signing the XPS document.
·         Determining who can access the document and for how long by applying document permissions.
If you have Microsoft .NET Framework 3.0, the XPS Viewer is installed on your PC.

To find out if you have .NET Framework 3.0


The XPS Viewer is included with .NET Framework 3.0.
If you do not have xps viewer in your windows xp operating system then install .net framework 3.0.

Get Query String Using Javascript

The following javascript code snippet facilitates Javascript's built in regular expressions to retrieve value of the key. Optionally, you can specify a default value to return when key does not exist.

you can use this method in your aspx page as:

Wednesday, October 12, 2011

Firefox Addons for Web Designers and Developers

Firefox is a free and open source web browser and most popular among Web Designers and Developers. If you see in the graph below (taken from smashingshare analytics), 64.57% users of SmashingShare are using FireFox. It makes the job of Web Designers and Developers much easier.

There is a huge list of  Firefox Addons or Extensions available to download but here today we will discuss only 30 Best Firefox Addons for Web Designers and Developers. You are not required to download or install all Firefox Addons or Extensions. There is a little brief with each Firefox Addon so you can read and decide which Addon suites you.

Greasemonkey

Greasemonkey is a Firefox addon / extension  that allows you to customize the way webpages look and function. Hundreds of scripts are already available for free. And if youre the tinkerer sort, you can also write your own.

Fasterfox

Fasterfox allows you to tweak many network and rendering settings such as simultaneous connections, pipelining, cache, DNS cache, and initial paint delay. Dynamic speed increases can be obtained with the unique prefetching mechanism, which recycles idle bandwidth by silently loading and caching all of the links on the page you are browsing.
A popup blocker for popups initiated by Flash plug-ins is also included.

Firebug

Firebug is an awesome Firefox Addon for Web Designers and Developers. Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

Web Developer

The Web Developer addon / extension adds a menu and a toolbar to the browser with various web developer tools. After installing the extension there is a Web Developer menu under the Tools and context menu of the browser, as well as a new toolbar.

FireFTP

FireFTP is a free, secure, cross-platform FTP client for Mozilla Firefox which provides easy and intuitive access to FTP servers.
Along with transferring your files quickly and efficiently, FireFTP also includes more advanced features such as: directory comparison, syncing directories while navigating, SFTP, SSL encryption, search/filtering, integrity checks, remote editing, drag & drop, file hashing, and much more!

YSlow

YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages. YSlow is a Firefox add-on integrated with the Firebug web development tool. YSlow grades web page based on one of three predefined ruleset or a user-defined ruleset. It offers suggestions for improving the pages performance, summarizes the pages components, displays statistics about the page, and provides tools for performance analysis, including Smush.it and JSLint.

FirePHP

FirePHP enables you to log to your Firebug Console using a simple PHP method call.
FirePHP is ideally suited for AJAX development where clean JSON or XML responses are required. All data is sent via a set of X-FirePHP-Data response headers. This means that the debugging data will not interfere with the content on your page.

Gridfox The Grid Layout Firefox Extension

GridFox is a Firefox extension that overlays a grid on any website. If you can open it in Firefox, you can put a grid on top of it. Its easy to customize, allowing you to create the exact grid you designed your layout around.

FireShot

FireShot is a Firefox Addon / Extension that creates screenshots of web pages (entirely or just visible part).
Unlike other extensions, this plugin provides a set of editing and annotation tools, which let users quickly modify web captures and insert text annotations and graphical annotations. Such functionality will be especially useful for web designers, testers and content reviewers.

Screengrab

Screengrab saves entire webpages as images. It will capture what you can see in the window, the entire page, just a selection, a particular frame basically it saves webpages as images either to a file, or to the clipboard.
It can capture any Java or Flash embedded in a page, but to do this it requires Java to be installed in the browser.

ColorZilla

With ColorZilla you can get a color reading from any point in your browser, quickly adjust this color and paste it into another program. You can Zoom the page you are viewing and measure distances between any two points on the page. The built-in palette browser allows choosing colors from pre-defined color sets and saving the most used colors in custom palettes. DOM spying features allow getting various information about DOM elements quickly and easily.

ColorSuckr

Make getting image colors even easier with the ColorSuckr Add-on for the Firefox browser. Install the add-on, then simply right click any image on a webpage and choose Extract Image Colors from the menu to go straight to the ColorSuckr website with the image.

CS Lite

CS Lite is a lighter, scaled down version of CookieSafe. This Firefox Addon contains less features, but is considerably easier to use. The extension has been completely recoded from top to bottom making this the most stable version to date.

CSSViewer

CSSViewer is a great Firefox Addon for Web Designers and Developers to learn CSS. When you hover on any element, it will display all CSS styles for that element.

Dummy Lipsum

Dummy Lipsum Firefox Addon/ Extension generates Lorem Ipsum dummy text (the text is taken from the Lorem Ipsum site). A context menu option (Insert Dummy Lipsum) is shown in the context menu when the cursor is in a form field (text field or text area). This option automatically fills this field with the dummy text.

IE Tab

IE Tab is a great Firefox Addon for Web Designers and Developers, since you can easily see how your web page displayed in IE with just one click and then switch back to Firefox.

IE NetRenderer

IE NetRenderer adds buttons, tools menu and contextual menu entries to get a screenshot of the current page.
Keyboard shortcuts are also available: Ctrl Shift F5/F6/F7/F8 to render the page in IE5.5/6/7/8 Beta 2 (Cmd Shift F* on Mac).
Really useful for webmasters which are not using Windows!

LiveHTTPHeaders

LiveHTTPHeaders allows you to analyze HTTP headers (response and requests). It help debugging web application. You can see which kind of web server the remote site is using and cookies sent by remote site.

OperaView

OperaView is an Addon/ Extension for Mozilla Firefox and Flock which is very similar (and actually based on) IE View.
Even if you are using Mozilla browser all the time, sometimes you need to view the page you are looking at in Opera browser (especially if you are a web developer). OperaView makes that process easier by adding the item View This Page in Opera to the page context menu, the item Open Link Target in Opera to the link context menu and a button to the toolbar. If you want to open a page in Opera quickly, just right click somewhere on the page and choose new menu item.

Adblock Plus

Ever been annoyed by all those ads and banners on the internet that often take longer to download than everything else on the page? Install Adblock Plus Firefox Addon now and get rid of them.

FEBE

FEBE (Firefox Environment Backup Extension) allows you to quickly and easily backup your Firefox Extensions. In fact, it goes beyond just backing up It will actually rebuild your extensions individually into installable .xpi files. Now you can easily synchronize your office and home browsers.

Xmarks (formerly Foxmarks)

Xmarks (Formerly Foxmarks) is the #1 bookmarking add-on. Install it on all your computers to keep your bookmarks and (optionally) passwords backed up and synchronized. Xmarks also helps you uncover the best of the web based on what millions of people are bookmarking.

Font Finder

Font Finder simply highlight a single element (e.g. a paragraph or a strong tag ), right-click and select `Font Finder`, then marvel as the full CSS text styling of the selected element appears.

URL Fixer

URL Fixer corrects typos in URLs that you enter in the address bar. For example, if you type google.con, it will correct it to google.com (asking first, if you enable confirmation).
This version will correct common misspellings of .com, .net, .org, .edu, .gov, .mil, and all other mainstream TLDs, as well as the protocol (http:, https:). By right-clicking on the address bar, you can set it to auto-correct your errors, or you can have it ask you before making any corrections.

MeasureIt

MeasureIt is a Useful Firefox Addon for Web Designers. This Addon draw out a ruler to get the pixel width and height of any elements on a webpage.

Window Resizer

Window Resizer resize your browser to various standard resolution sizes. It is useful for testing different screen sizes. It accurately resizes your browser so you can test to see what a web page looks like in all of the standard resolution sizes. Supports the 640480, 800600, 1024768, 1280800, 12801024, 16001200 resolutions.

Palette Grabber

Palette Grabber creates a color palette for Photoshop, Paint Shop Pro, GIMP, Flash, Fireworks, Paint.NET, or OS X based on the current page.

Panic

Are you looking at stuff you shouldnt be? Whether you are browsing through social networking sites while youre at work or wandering around MySpace while youre at school? Well Panic Firefox Extension gives you the ability to close all tabs, while opening another one that will make it look like you are doing what you should be doing.

Cooliris

The Cooliris 3D Wall Simply the fastest and most stunning way to browse photos and videos from the Web or your desktop. Effortlessly scroll an infinite 3D Wall of your content from Facebook, Google Images, YouTube, Flickr, and hundreds more.

Morning Coffee

Morning Coffee keeps track of daily routine websites and opens them in tabs. This extension lets you organize websites by day and open them up simultaneously as part of your daily routine. This is really handy if you read sites that update on a regular schedule (like webcomics, weekly columns, etc.)

ReminderFox

ReminderFox displays and manages lists of date-based reminders and ToDos. ReminderFox does not seek to be a full-fledged calendar. In fact, the target audience is anybody that simply wants to remember important dates (birthdays, anniversaries, bills, etc) without having to run a whole calendar application. ReminderFox makes sure you remember all of your important dates via easy-to-use lists, alerts, and alarm notifications.

 

Failed to access IIS metabase.

Scenario:-
I have windows XP Professional installed on my machine and I got this error after
configuration of my virtual directory on IIS.

Server Error in '/myweb' Application.


Failed to access IIS metabase.

Description: An unhandled exception occurred during the execution of the current web request. Please review
the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase
(e.g. IIS://servername/W3SVC). For information on modifying metabase permissions,
please see http://support.microsoft.com/?kbid=267904.


Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the exception
can be identified using the exception stack trace below.


Stack Trace:

 
[HostingEnvironmentException: Failed to access IIS metabase.]
   System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +1076
   System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +301
   System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51
   System.Web.CachedPathData.GetPhysicalPath(VirtualPath virtualPath) +39
   System.Web.CachedPathData.GetConfigPathData(String configPath) +704
   System.Web.CachedPathData.GetConfigPathData(String configPath) +583
   System.Web.CachedPathData.GetApplicationPathData() +38
   System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +8778063
   System.Web.Configuration.RuntimeConfig.GetConfig(VirtualPath path) +46
   System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +96

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Solution :-

This Error Caused Because You Not Have Register ASP.Net with IIS.
Please Follow Following Step to Regiser ASP.Net With IIS.

 

-> Go to Start - >  Run -> Cmd.

 

-> GO to Your System Drive Mostly C Drive.

 

-> Type C:\WINDOWS\Microsoft.NET\Framework\<your framework version directory>\aspnet_regiis -i

Just wait And Message comes Successfully Register.

Or you go to your visual studio command prompt in visual studio tools and run the same command

aspnet_regiis –i

 

 

Thursday, October 6, 2011

Creating Dialogbox in C graphics - mouse program

#include<stdio.h>
#include<fstream.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
int gd=0,gm,y,getx,gety;
char px[2],py[2];
union REGS in,out;
initgraph(&gd,&gm,"");
setfillstyle(1,7);
bar(100,100,300,220);
setfillstyle(1,1);
bar(102,102,298,113);
setfillstyle(1,7);
bar(285,103,295,111);
settextstyle(2,0,4);
outtextxy(104,102,"Save");
setcolor(0);
outtextxy(140,130,"Save Changes to untitled?");
////
setcolor(15);
line(285,103,295,103);
line(285,103,285,111);
setcolor(0);
line(295,103,295,111);
line(286,111,295,111);
outtextxy(288,100,"x");
////
////
setcolor(15);
line(115,160+40,160,160+40);
line(115,160+40,115,175+40);
setcolor(0);
line(160,160+40,160,175+40);
line(115,175+40,160,175+40);
outtextxy(130,162+40,"Yes");
////
setcolor(15);
line(170,160+40,215,160+40);
line(170,160+40,170,175+40);
setcolor(0);
line(215,160+40,215,175+40);
line(170,175+40,215,175+40);
outtextxy(185,162+40,"No");
////
setcolor(15);
line(225,160+40,270,160+40);
line(225,160+40,225,175+40);
setcolor(0);
line(270,160+40,270,175+40);
line(225,175+40,270,175+40);
outtextxy(231,162+40,"Cancel");
////
getch();
}

Tuesday, October 4, 2011

Paint in C++ - Include File for Paint

TIC TOE Game in C

#include<iostream.h>

#include<graphics.h>

#include<stdlib.h>

#include<dos.h>

#include<conio.h>

#define UP 72

#define DOWN 80

#define LEFT 75

#define RIGHT 77

#define ESC 27

void main()

{

                clrscr();

                int gd=0,gm,i,j,k,x,y,a[8];

                int x1,y1;

                initgraph(&gd,&gm,"");

                randomize();

                char *aa;

                for(i=1;i<=8;i++)

                {

                start:

                                j=random(8)+1;

 

                                for(k=1;k<=i;k++)

                                                if(a[k]==j)

                                                                goto start;

                                                a[i]=j;

                }

                char c[10];

                i=1;

                for(x=100,y=100;x<=300;x+=100)

                {

                                for(y=100;y<=300;y+=100)

                                {

                                                itoa(i,c,10);

                                                setcolor(GREEN);

                                                setlinestyle(0,0,3);

                                                rectangle(x,y,x+100,y+100);

                                                rectangle(x+20,y+20,x+80,y+80);

                                                if(i<=8)

                                                {

                                                setfillstyle(1,YELLOW);

                                                floodfill(x+30,y+30,GREEN);

                                                setcolor(RED);

                                                setlinestyle(0,0,3);

                                                circle(x+45,y+45,10);

                                                setfillstyle(1,RED);

                                                floodfill(x+45,y+45,RED);

                                                setcolor(BLUE);

                                                outtextxy(x+43,y+43,c);

                                                }

                                                i++;

                                }

                }

                setcolor(BLUE);

                setlinestyle(0,1,3);

                rectangle(320,320,380,380);

                x=320,y=320;

                char z;

                while(1)

                {

                                while(kbhit())

                                {

                                                z=getch();

                                                setlinestyle(0,1,3);

                                                setcolor(GREEN);

                                                rectangle(x,y,x+60,y+60);

                                                if(z==UP)

                                                {

                                                                if(y>120)

                                                                                y-=100;

                                                }

                                                else if(z==DOWN)

                                                {

                                                                if(y<320)

                                                                                y+=100;

                                                }

                                                else if(z==LEFT)

                                                {

                                                                if(x>120)

                                                                                x-=100;

                                                }

                                                else if(z==RIGHT)

                                                {

                                                                if(x<320)

                                                                                x+=100;

                                                }

                                                else if (z==ESC)

                                                {

                                                                exit(0);

                                                }

                                                else if(z==' ')

                                                {

                                                                x1=x+30,y1=y+30;

                                                                if(getpixel(x1,y1)==RED)

                                                                {        //putpixel(x1,y1,YELLOW);

                                                                                if(getpixel(x1,y1+100)==BLACK&&y<320)

                                                                                {

 

                                                                                                getimage(x+10,y+10,x+40,y+40,aa);

                                                                                                setfillstyle(1,BLACK);

                                                                                                floodfill(x+10,y+10,GREEN);

                                                                                                setfillstyle(1,YELLOW);

                                                                                                floodfill(x+10,y+120,GREEN);

                                                                                                putimage(x+10,y+110,aa,0);

                                                                                }

                                                                                else if(getpixel(x1,y1-100)==BLACK&&y>200)

                                                                                {

                                                                                                getimage(x+10,y+10,x+40,y+40,aa);

                                                                                                setfillstyle(1,BLACK);

                                                                                                floodfill(x+10,y+10,GREEN);

                                                                                                setfillstyle(1,YELLOW);

                                                                                                floodfill(x+10,y-90,GREEN);

                                                                                                putimage(x+10,y-90,aa,0);

                                                                                }

                                                                                else if(getpixel(x1-100,y1)==BLACK&&x>120)

                                                                                {

                                                                                                getimage(x+10,y+10,x+40,y+40,aa);

                                                                                                setfillstyle(1,BLACK);

                                                                                                floodfill(x+10,y+10,GREEN);

                                                                                                setfillstyle(1,YELLOW);

                                                                                                floodfill(x-90,y+10,GREEN);

                                                                                                putimage(x-90,y+10,aa,0);

                                                                                }

                                                                                else if(getpixel(x1+100,y1)==BLACK&&x<320)

                                                                                {

                                                                                                getimage(x+10,y+10,x+40,y+40,aa);

                                                                                                setfillstyle(1,BLACK);

                                                                                                floodfill(x+10,y+10,GREEN);

                                                                                                setfillstyle(1,YELLOW);

                                                                                                floodfill(x+110,y+10,GREEN);

                                                                                                putimage(x+110,y+10,aa,0);

                                                                                }

                                                                }

 

                                                     }

                                                     }

                                setcolor(BLUE);

                                setlinestyle(0,0,3);

                                rectangle(x,y,x+60,y+60);

                }

                getch();

}