Solved

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

Posted on 2011-09-20
2
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

724 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