Solved

How to Write a Script Manager for AJAX code in ASP.NET/C#

Posted on 2011-09-20
2
343 Views
Last Modified: 2012-08-13
I am attempting to write a calendar control using AJAX as an extension, and I was wondering if someone could tell me how to write a Script Manager for the code that I would be using, which is attached, and what the purpose of the script manager is in terms of AJAX, ASP.NET, and C#.

Thank you in advance for your time and your help.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FuelReceiptsResearch._Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Fuel Receipt Research</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
                <tr>
                <td colspan="">
                <img alt="" src="images/ta_header.jpg" style="width: 720px; height: 72px" /></td></tr>
        </table>
    
    </div>
    <p></p>
    <p>
    <asp:Literal ID="SiteLiteral" runat="server" Text="Location Number:"></asp:Literal>
    <asp:TextBox ID="SiteTextBox" runat="server" BackColor="White"></asp:TextBox>
    </p>
    
    <p>
    <asp:Literal ID="TotalDollarLiteral" runat="server" Text="Total Dollar Amount:"></asp:Literal>
    <asp:TextBox ID="TotalDollarTextBox" runat="server" BackColor="White"></asp:TextBox>
    </p>
    
    <p>
    <asp:Literal ID="TotalDieselSalesLiteral" runat="server" Text="Total Diesel Sales:"></asp:Literal>
    <asp:TextBox ID="TotalDieselSalesTextBox" runat="server" BackColor="White"></asp:TextBox>
    </p>
    
    <p>
    <asp:Literal ID="TotalDieselGallons" runat="server" Text="Total Diesel Gallons:"></asp:Literal>
    <asp:TextBox ID="TotalDieselGallonsTextBox" runat="server" BackColor="White"></asp:TextBox>
    </p>
    
    <asp:TextBox runat="server" ID="txtfrom" />
    <cc1:CalendarExtender runat="server" ID="calfrom" TargetControlID="txtfrom" />
       <asp:TextBox runat="server" ID="TextBox1" />
    <asp:TextBox runat="server" ID="txtto" />
    <cc1:CalendarExtender runat="server" ID="calto" TargetControlID="txtto" /> 
        <asp:TextBox runat="server" ID="TextBox2" />

    <br />
    <asp:Button ID="Searchbtn" runat="server" Text="Search" 
        onclick="Searchbtn_Click" style="height: 26px" />
    <asp:Button ID="Resetbtn" runat="server" Text="Reset" />
    
    </form>

</body>
</html>

Open in new window

0
Comment
Question by:thenthorn1010
2 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 250 total points
ID: 36570135
You do not need to write it. Script manager comes as part opf Asp.net ajax, check:
http://msdn.microsoft.com/en-us/magazine/cc163354.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.aspx

Script manager manages ASP.NET Ajax script libraries and script files, partial-page rendering, and client proxy class generation for Web and application services.

Your code seems to need UpdatePanel for the table if the table contents change often with respect to the other components on your page. You only use Ajax when you need partial page rendering.


0
 
LVL 15

Assisted Solution

by:Eyal
Eyal earned 250 total points
ID: 36572926
I would recommend you using this component with JQuery
http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/

Microsoft generated scripts adds a lot of overhead to the page
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now