Solved

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

Posted on 2011-09-20
2
347 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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