Solved

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

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to refresh a page from a sub domain in ajax ? 34 47
disable data migrations in visual studio 2017 4 50
Set custom font WPF 2 21
Need help for captcha 2 21
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 …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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…

726 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