Showing posts with label ASP-DOT-NET. Show all posts
Showing posts with label ASP-DOT-NET. Show all posts

Saturday, January 29, 2011

AJAX with ASP.NET

Imagine, you want to highlight a TextBox when the user moves the mouse over it. With the postback approach, you’d need to send the entire page back to the web server, regenerate it, and refresh it in the browser—by which point the mouse might be somewhere completely different. This approach is clearly impractical.

Ajax(Asynchronous JavaScript and XML)is programming shorthand for a set of techniques that create more responsive, dynamic pages. One of the hallmarks of Ajax is the ability to refresh part of the page while leaving the rest untouched.Ajax is nothing but JavaScript code that runs in the browser, requesting the new information from the web server when needed and updating the page accordingly.

The key benefit of Ajax is responsiveness, where as the challenges are code complexity and browser support.

TO use AJAX in ASP.net, we need to place a new web control ScriptManager on our page, and it’s the brains of ASP.NET AJAX .

If you’re using ASP.NET AJAX features throughout your website, you might choose to place the ScriptManager in a master page. However, this can occasionally cause problems, because different content pages may want to configure the properties of the ScriptManager differently. In this scenario, the solution is to use the ScriptManager in the master page and the ScriptManagerProxy in your content page. (You can find the ScriptManagerProxy on the same AJAX Extensions tab of the Toolbox.) Each content page can configure the ScriptManagerProxy control in the same way it would configure the ScriptManager.


All the elements and controls are kept between the tags.
When the UpdatePanel renders itself, it copies the content from the ContentTemplate into the page. This seems like a fairly unimportant low-level detail, but it does have one important side effect. If you want to use code to dynamically add controls to an UpdatePanel, you can’t use the UpdatePanel.Controls collection. Instead, you need to add new controls to the UpdatePanels.ContentTemplateContainer.Controls collection.

Friday, January 28, 2011

Registering the ASP.NET File Mappings: To run asp pages in IIS server

When a page is requested from the browser, that comes to the web server. The pages can be of different format i.e html, jsp, asp etc. The server is not the master of all for serving all types of pages.
At this point, one might be wondering how the web server knows when it needs to get the ASP or ASP.NET engine involved. Essentially, the web server looks at the file extension of the requested page (such as .asp or .aspx) to determine the type of content. The web server compares this extension against a list to determine what program owns this file type. For example, the web server’s list indicates that the .aspx extension is owned by the aspnet_isapi.dll component in the corresponding directory. The aspnet_isapi.dll component is known as an ISAPI extension, because it uses the ISAPI (Internet Server API) model to plug into the web server.

The easiest way to make sure you get the right version of aspnet_regiis is to rely on the Visual Studio Command Prompt. The Visual Studio Command Prompt is really just an ordinary Windows command prompt, but it sets the path variable so that the tools you need are at your fingertips. When you type aspnet_regiis.exe in the Visual Studio Command Prompt (without specifying a path), you’ll automatically run the correct version.
To start the Visual Studio Command Prompt, open the Start menu, choose Programs, and then choose Microsoft Visual Studio 2008 -->Visual Studio Tools -->Visual Studio 2008 Command Prompt.

Then for installing type the following
aspnet_regiis.exe -i


and then press enter.

If IIS is installed before installing Visual Studio, IIS is automatically configured for serving ASP pages by using asp engine. If not, then use the above code for configuring.

Monday, January 24, 2011

Add Date picker to ASP page from AjaxControlToolkit

Atfirst make a folder named i.e "Library" in your project folder. Then go to the References of Solution Explorer.

And Right Click-->Add References-->Select Browse--> Select the file from the location--> Add it.
Then add the text box, the target of the Selected Date. And also take a button or image by clicking which we will get our Calender.

The add the following code after the code of Button in the source view of the Form.

asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtBoxName" PopupButtonID="btnName"
Format="dd-MMM-yyyy"/>

Here the Format is used to define the format of your desired date to view.
After that, go to the next line of the FORM tag in your page. If you are using the Master Page as the part of your design. You will have to go to the FORM tag of your master page.Now you will have to add ScriptManager. For doing so, you will add the following line:


asp:ScriptManager ID="ScriptManager1" runat="server"/>


That's enough. You will get the Calender to pick the date.


IN this topic we have used code, but you can get this tool automatically from the Html portion of Toolbox menu. For doing so, you will have to Right Click on the lower part of Toolbox and then add the AjaxControlTool.dll from your made Library Folder. Then you will get these items from the Toolbox menu.


Click to get AjaxControlTool

Saturday, November 27, 2010

Basic of Crytal Report Creation

You can familiarize yourself with Crystal Reports for Blackbaud by designing a simple report that lists the number of students in each grade level.
First, use Query to group all records with the status Current Student.

1. Select to create a new dynamic, student query. Click OK.
2. Select the filter criteria Status Equals Current Student.
3. Mark the Sort option and highlight Grade Level Now. Click Sort. Sort by Table Order.
4. Highlight Student Name and click Sort. Sort in ascending order.
5. You can select any fields for output, because they are used only for visual verification of your results. Select the minimum number of fields necessary.
6. Select File, Run Query from the menu bar.
7. Save and name the query. Mark Other Users May Execute this Query to allow other users to run but not change your query. They can modify copies of the query only by selecting File, Save As from the menu bar. To protect the original query, unmark Other Users May Modify this Query.

In Export, extract, or copy, certain information from the group of Current Student records to a data file Crystal Reports can read.

1. Select to create a new student export.
2. Choose Selected Records and select the query you just created. Do not mark Load Query Output Fields. (Remember, they are simply used to verify your query results. In this module you select the fields for your report.)
3. Highlight Student Name and Grade Level Now (Short Grade Level) and click Add Field. You can extract fields in any order, though they may be easier to use in Crystal Reports if you choose a practical sequence.
4. Select File, Export from the menu bar. On the Export Format screen, select MS Access Report Writer Database. Mark Print Control Report. Click OK.
5. On the Enter Export File Name screen, enter a file name that does not exceed eight characters plus the three-character extension. Click OK.
6. After processing is complete, print the Custom Export Control Report, which documents the data file’s name and path.

In Crystal Reports, you manipulate your exported data to create a report.

1. Click New Report. Click Custom on the Report Gallery screen.
2. Click Data File. Select the MDB file you just exported.
3. Select Insert, Group from the menu bar. Group by Grade Level Now in ascending order. Click OK. Your final report’s results will appear in grade level order.
4. Select Insert, Database Field from the menu bar. On the Insert Fields screen, place Grade Level Now in the Details section in one of three ways:
* Click on the field name and drag it to the Details section.
* Double-click on the field name and place it in the Details section.
* Highlight the field name, click Insert, and place the field in the Details section.
5. To calculate the number of students in each grade level, select Insert, Summary from the menu bar. On the Common tab, select Count. Click OK. When you print the report, the records appear sorted and grouped by Student Grade Level Now. The number of students in each grade level also prints.
6. Right-click on the gray part of the Details section. Select Suppress (No Drill-Down) from the menu.
7. Select File, Print Preview from the menu bar.

Tips for Using Totals and Counts in Crystal Reports

Having trouble totaling reports in Crystal Reports? These tips should help.

1. To create a subtotal of an amount field, right-click on the field in the detail line and select Insert Subtotal. Select on what to base the subtotal and click OK.

2. To create a grand total of amounts, right-click on the field you want to total and select Insert Grand Total.

3. To underline the totals, right-click on the field and select Format Field. Select Borders. Select single line on top and double line on bottom.

4. To get a total count of records listed on the report, right-click on the field that is not an amount and select Insert Grand Total. Select Count to have the program count each line and give you the total number of records.

5. To get a total count of individual records (such as vendors with multiple invoices), right-click on the Name field, select Insert Grand Total and Distinct Count. This counts items that are the same only once. For example, if ABC Company were listed three times on the list, the program would count it as only one record.
Changing Report Field Properties in Crystal Reports

Have you ever wanted to add or sort on a text field that is a number? The ToNumber function in Crystal Reports can convert a non-numeric field, specifically a text field, into a numeric field when you need to perform arithmetic on the field or sort the field in numeric order. For example, you export Constituent ID for sorting or grouping in a report, but discover that because it is an alphanumeric field, it sorts in alphanumeric order instead of numeric order. To sort or group by this field numerically, convert the field using the ToNumber function.

For the ToNumber function to work properly, the field you want to convert must be populated with numbers only. When using this function, you should first test the value with the NumericText function. If NumericText returns the value TRUE, then you can convert it to a number. If you try to convert a value to a number that is not numeric, the formula produces an error in the report.

The following example uses both functions: If the text string, Constituent ID, can be converted to a number, then convert it to a number else, use zero as the value.

If NumericText ({Constituent.ConstituentID}) Then ToNumber ({Constituent.ConstituentID}) Else 0

With this formula, the Constituent ID field is converted from a text string to a number and may now be used for sorting or grouping in numeric order.

This function might also be used for an Attribute Description or Comment field. The formula would be if the text field, Attribute, can be converted correctly from a text string to a number, then convert it to a number otherwise, use zero as the value.

If NumericText ({Attribute}) Then ToNumber ({Attribute}) Else 0

The field Attribute, originally a text field that contained only numbers, is now considered by Crystal Reports to be a numeric field and may be subtotaled or used in other arithmetic functions.

The combination of the NumericText and ToNumber functions allows you to easily convert report fields. These formulas can be used for any text field providing the values are solely numeric.

Source: Blackbaud

Sunday, June 27, 2010

unable to connect to asp.net development server

Recently, I have started to make deal with ASP.net to learn that. And I firstly installed the Visual Studio 2008 and wrote the code. But when I start to debugging, I was helpless, as I am not a man with a lot of concentration. And most of the cases at past, I stopped programming when a error arouse me. But at this time I have started to face the problem, as its my target.
But this session isn't different from the before. When I start to debug my first program, I find the message "unable to connect to asp.net development server". As its my challenge, I use the internet and solve he problem. You can solve it following the steps

first download the file from following link
http://www.esnips.com/doc/9ef73cba-6d6a-4e76-a42d-83b58024300e/WebDev.WebServer
extract the file ..
u will get an exe named WebDev.WebServer.exe
simply right click and copy it..
now..
goto your drive containing windows...
by deault this is c drive..
so open
the following path...
C:\Program Files\Common Files\microsoft shared\DevServer\9.0
you will find already a file named WebDev.WebServer.exe..
so what you have to do is simply replace this file...
by right click and paste...
and click yes on the message that you want to replace the file..
yes its done ...

N.B: