Dynamically Add User Control With Web Service - web-services

i am facing a problem regarding User control with the web service please help me
i have made an interface call IcustomeClass which have one method called GetHtml
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for ICustomeClass
/// </summary>
public interface ICustomeClass
{
string GetHtml(string controlLocation);
}
i have a class called ControlBaseClass which inherit from UserControl and ICustomeClass
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.IO;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for ControlBaseClass
/// </summary>
public class ControlBaseClass : UserControl, ICustomeClass
{
public ControlBaseClass()
{
}
public string GetHtml(string controlLocation)
{
return GetControlHtml(controlLocation);
}
private string GetControlHtml(string control)
{
var controlMarkup = string.Empty;
Page page = new Page();
var customControl = page.LoadControl(control) as UserControl;
if (customControl != null)
{
var htmlForm = new HtmlForm();
var output = new StringWriter();
htmlForm.Controls.Add(customControl);
page.Controls.Add(htmlForm);
HttpContext.Current.Server.Execute(page, output, false);
controlMarkup = output.ToString();
}
return controlMarkup;
}
}
and i have a service called ControlService
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
/// <summary>
/// Summary description for LoadControlService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class LoadControlService : System.Web.Services.WebService
{
public LoadControlService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string GetControlHtml(string controlLocation)
{
ControlBaseClass controlBase = new ControlBaseClass();
return controlBase.GetHtml(controlLocation);
}
}
and i am using AJAX Script Manager on my Page
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/Services/LoadControlService.asmx" />
</Services>
<CompositeScript>
<Scripts>
<asp:ScriptReference Path="~/Scripts/ControlScript.js" />
</Scripts>
</CompositeScript>
</asp:ScriptManager>
<table>
<tr>
<td>
<input id="AddBrandButton" type="button" value="Brand" onclick="GetControl('~/UserControls/AddMovies.ascx')" />
</td>
<td>
<input id="AddConsoleButton" type="button" value="Console" onclick="GetControl('~/UserControls/AddLog.ascx')" />
</td>
</tr>
</table>
<div id="ResultDiv">
</div>
</div>
</form>
</body>
i have a java script code which use a web service for getting user control html
/// <reference path="../MainPage.aspx" />
/// <reference name="MicrosoftAjax.js"/>
function GetControl(control) {
LoadControlService.GetControlHtml(control, ControlSuccess, ControlFailure, "");
}
function ControlSuccess(result) {
var div = $get('ResultDiv');
div.innerHTML = result;
}
function ControlFailure(error) {
alert(error);
}
i have two button on my page called Add Movies and Add Log when i click the button the webservice return the html of user control and it display on the page its work fine now my problem is that when i click first button the user control appear and i add the data in the text boxes but when i click the second button another user control appear and the previous user control disappear.
i want to hold the data of the previous control tex boxes so that i can save all the data in the database in one click in other word i am making a tab controls which will save all of the data in one click.

Related

Converting JSON response observable to angular (typescript) object array

I have a service API that pulls data from Django-REST. The returned JSON looks like:
[
{
"manufacturer": "Mfg",
"model": "Model",
},
{
"manufacturer": "Mfg2",
"model": "Model2",
}
]
The service API function getData returns:
return this.httpClient.get(`${this.apiURL}/data/`);
Note I am using ListAPIView in Django, and I have verified that the above URL returns the JSON object shown above (though I have to add ?format=json to get the raw data outside of Django's APIView).
I then have an angular component that calls the service API function to convert the observable to an array of objects:
export class Data implements OnInit {
private records = Array<object> = [];
...
constructor(private apiService: ApiService) {}
ngOnInit() {
this.getData();
}
public getData() {
this.apiService.getData().subscribe((data: Array<object>) => {this.records = data});
There are no error or warnings, but in the component's HTML file when I try to access the record array it always has a length of 0. For example, the following will print "0" and an empty table.
<P> {{ records.length }}</P>
<table>
<tr>
<th>Manufacturer</th>
</tr>
<tr *ngFor="let record of records">
<td> {{ record.manufacturer }} </td>
</tr>
</table>
What am I missing?
If you define a model using an interface, and then use that interface as a generic parameter to the get call, the HttpClient will automatically map the response to the defined structure.
For example:
Interface
export interface Product {
manufacturer: string;
model: string;
}
Data Service
return this.httpClient.get<Product[]>(`${this.apiURL}/data/`);
Component
private records: Product[];
public getData() {
this.apiService.getData().subscribe((data: Product[]) => this.records = data);
}
EDIT: If you want to add a console.log to the above, you need to add it like this:
public getData() {
this.apiService.getData().subscribe((data: Product[]) => {
this.records = data;
console.log(this.records);
);
}
Template
<div *ngIf="records">
<p> {{ records.length }}</p>
...
</div>
When the template first appears, the async data retrieval process may not yet have finished. So by putting an ngIf around the page, it won't attempt to display the elements until the data is retrieved.
you need to add the async pipe to it.
<tr *ngFor="let record of records|async">
<td> {{ record.manufacturer }} </td>
</tr>

Simple Cognito User Authentication With Code Grant Not working

I am trying to create a simple static website that uses AWS Cognito to authenticate users. That means I'm not using any advanced libraries but basing my code on the AWS example here.
If I use the default 'token' flow then the example works for my domain. However, as recommended by Amazon themselves in several places e.g. here I want to used 'code grant' flow, and as state in the example above I just uncomment line 221:
auth.useCodeGrantFlow();
However this fails causing the onFailure function to be called although oddly I do see the URL bar containing code=xxxxx. It appears there are more steps I need to do but all examples I find demonstrate the less favourable 'token flow'.
This is my specific index.html based on the above example:
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Cognito Auth JS SDK Sample</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="stylesheets/styleSheetStart.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="dist/amazon-cognito-auth.min.js"></script>
<!-- To enable the advanced security feature -->
<!-- <script src="https://amazon-cognito-assets.<region>.amazoncognito.com/amazon-cognito-advanced-security-data.min.js">
</script> -->
<!-- E.g. -->
<!-- <script src="https://amazon-cognito-assets.us-east-1.amazoncognito.com/amazon-cognito-advanced-security-data.min.js">
</script> -->
</head>
<body onload="onLoad()">
<ul>
<li><a href="https://aws.amazon.com/cognito/" target="_blank"
title="Go to AWS Cognito Console">Cognito Console</a></li>
<li><a href="http://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html"
target="_blank" title="See Cognito developer docs">Docs</a>
</li>
</ul>
<h1>
<a href="http://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html" target="_blank">
<img src="img/MobileServices_AmazonCognito.png" alt="Amazon Cognito" title="Amazon Cognito"
style="width:144px;height:144px;"></a><br>
Amazon Cognito Auth Demo
</h1>
<!--removed for brevity -->
<div><br></div>
<div>
<p id="statusNotAuth" title="Status">
Sign-In to Continue
</p>
<p id="statusAuth" title="Status">
You have Signed-In
</p>
</div>
<div class="tabsWell">
<div id="startButtons">
<div class="button">
<a class="nav-tabs" id="signInButton" href="javascript:void(0)" title="Sign in">Sign In</a>
</div>
</div>
<div class="tab-content">
<div class="tab-pane" id="userdetails">
<p class="text-icon" title="Minimize" id="tabIcon" onclick="toggleTab('usertab');">_</p>
<br>
<h2 id="usertabtitle">Tokens</h2>
<div class="user-form" id="usertab">
<pre id="idtoken"> ... </pre>
<pre id="acctoken"> ... </pre>
<pre id="reftoken"> ... </pre>
</div>
</div>
</div>
</div>
<script>
// Operations when the web page is loaded.
function onLoad() {
var i, items, tabs;
items = document.getElementsByClassName("tab-pane");
for (i = 0; i < items.length; i++) {
items[i].style.display = 'none';
}
document.getElementById("statusNotAuth").style.display = 'block';
document.getElementById("statusAuth").style.display = 'none';
// Initiatlize CognitoAuth object
var auth = initCognitoSDK();
document.getElementById("signInButton").addEventListener("click",
function() {
userButton(auth);
});
var curUrl = window.location.href;
auth.parseCognitoWebResponse(curUrl);
}
// Operation when tab is closed.
function closeTab(tabName) {
document.getElementById(tabName).style.display = 'none';
}
// Operation when tab is opened.
function openTab(tabName) {
document.getElementById(tabName).style.display = 'block';
}
// Operations about toggle tab.
function toggleTab(tabName) {
if (document.getElementById("usertab").style.display == 'none') {
document.getElementById("usertab").style.display = 'block';
document.getElementById("tabIcon").innerHTML = '_';
} else {
document.getElementById("usertab").style.display = 'none';
document.getElementById("tabIcon").innerHTML = '+';
}
}
// Operations when showing message.
function showMessage(msgTitle, msgText, msgDetail) {
var msgTab = document.getElementById('message');
document.getElementById('messageTitle').innerHTML = msgTitle;
document.getElementById('messageText').innerHTML = msgText;
document.getElementById('messageDetail').innerHTML = msgDetail;
msgTab.style.display = "block";
}
// Perform user operations.
function userButton(auth) {
var state = document.getElementById('signInButton').innerHTML;
if (state === "Sign Out") {
document.getElementById("signInButton").innerHTML = "Sign In";
auth.signOut();
showSignedOut();
} else {
auth.getSession();
}
}
// Operations when signed in.
function showSignedIn(session) {
document.getElementById("statusNotAuth").style.display = 'none';
document.getElementById("statusAuth").style.display = 'block';
document.getElementById("signInButton").innerHTML = "Sign Out";
/* Removed for brevity */
openTab("userdetails");
}
// Operations when signed out.
function showSignedOut() {
document.getElementById("statusNotAuth").style.display = 'block';
document.getElementById("statusAuth").style.display = 'none';
document.getElementById('idtoken').innerHTML = " ... ";
document.getElementById('acctoken').innerHTML = " ... ";
document.getElementById('reftoken').innerHTML = " ... ";
closeTab("userdetails");
}
// Initialize a cognito auth object.
function initCognitoSDK() {
var authData = {
ClientId : '<Removed>', // Your client id here
AppWebDomain : '<Removed>', // Exclude the "https://" part.
TokenScopesArray : [<removed>], // like ['openid','email','phone']...
RedirectUriSignIn : '<domain removed>/index.html',
RedirectUriSignOut : '<domain removed>/index.html'
};
var auth = new AmazonCognitoIdentity.CognitoAuth(authData);
// You can also set state parameter - do I need to set this?
auth.setState('ABCDXYZ');
auth.userhandler = {
onSuccess: function(result) {
alert("Sign in success");
showSignedIn(result);
},
onFailure: function(err) {
alert("Error!" + err);
}
};
// The default response_type is "token", uncomment the next line will make it be "code".
auth.useCodeGrantFlow();
return auth;
}
</script>
</body>
</html>
In dev tools I do see a call to https://<domain-name-removed>/oauth2/token but looks like it comes back with a 400 error.The response text is "error":"invalid_client".
Is there some additional configuration I need to do, or as suggested in the AWS docs for authorisation code grant flow I need to implement additional BE code? I feel the example code is lacking a full description for code grant flow.
According to
It turns out that when I created the the app client for the user pool I created it with a secret key. This key must be returned in the header as part of the authentication process which I wasn't doing; the aws example doesn't indicate how this is achieved. Instead direction is given to create the app client without an app secret key
If I understand your use case correctly you should not use an app client secret for this. The AWS example is indeed correct, the code you get in the url is meant to be used in another request in the process of acquiring the real code aka access_token.

Sitecore MVC Sitecore.Mvc.Presentation.RenderingModel

I am pretty new at sitecore and i faced a problem when rendering controller.
As you can see from below picture i created a "Mainlayout" and putted the placeholders.
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
#Html.Sitecore().Placeholder("content")
#Html.Sitecore().Placeholder("content1")
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div>
After that i created a class Driver which contains Name and Text properties
public class Driver
{
public HtmlString Name { get; set; }
public HtmlString Text { get; set; }
}
The third picture has a method for getting the driver.
public class DriverRepository
{
public Driver GetDriver()
{
var driver = new Driver();
var rendering = RenderingContext.Current.Rendering;
var datasource = rendering.Item;
driver.Name = new HtmlString(FieldRenderer.Render(datasource, "Name"));
driver.Text = new HtmlString(FieldRenderer.Render(datasource, "Text"));
return driver;
}
}
After that i created a controller Driver with actionresult Featured
public class DriverController : Controller {
// GET: Driver public ActionResult Featured() {
var repository = new DriverRepository();
var driver = repository.GetDriver();
return View(driver);
}
}
And generated the view for the controller
using Sitecore.Mvc
model TestMvcTaulantTutorial.Models.Driver
Name : Model.Name <br />
Text : Model.Text
After that in sitecore I created a controller rendering for the Driver controller
I specified to home page this rendering to be read to content1
But when I deploy it returns me this error
The model item passed into the dictionary is of type
'TestMvcTaulantTutorial.Models.Driver', but this dictionary requires a
model item of type 'Sitecore.Mvc.Presentation.RenderingModel'.
1. My first assumption, as far as I understood from your description, seems that your rendering is not re-deployed and you are having a previous version of the same rendering at your deployment target, because dictionary requires a model item of type 'Sitecore.Mvc.Presentation.RenderingModel' while you have clearly specified correct model at the top:
model TestMvcTaulantTutorial.Models.Driver
... so that's probably another rendering being taken.
2. Another assumption, could you please replace that:
return View(driver);
.. with thу code below, explicitly specifying your view path, just to understand wether that is a root of a problem:
return View("your_correct_view_path", driver);
3. Also, what I've noticed, on a view you should have:
Name : #Model.Name <br/>
Text : #Model.Text
instead of:
Name : Model.Name <br/>
Text : Model.Text
The Driver class should inherit from RenderingModel class.
public class Driver: Sitecore.Mvc.Presentation.RenderingModel { .. }
I think Rvan is right. That error caused you to create the view rendering and not the controller rendering. Remember in the naming convention you don't need the controller keyword after the controller's name.

Binding a DropDownList in Kendo Scheduler Custom Template (ASP.NET MVC Wrapper version)

I'm using the ASP.NET MVC wrapper for Kendo UI and I'm trying to bind several dropdownlists within a custom template (x-kendo-template). I can't figure out how to do this using the ASP.NET MVC Wrapper (this is similar to this question: How do I bind a DropDownList to a DataSource within an editor template using the scheduler?).
There are some examples on using the Kendo Web version, but no complete examples out there that show using a custom pop-up editor with the scheduler that contains a dropdownlist pulling data from a URL (json data).
Is there an end-to-end example? I can load the scheduler with data. The issue is with the custom template and dropdownlist binding.
EDIT:
After searching extensively, I stumbled upon a "getting started" page from Telerik on using the Kendo UI Scheduler in ASP.NET MVC. They (Telerik) really need to do a better job cross-linking between Demos to Documentation to APIs and Examples (Here is the example)
I've also created a blog post that wraps everything for a Scheduler (from the database table to the Views), you can see that here.Kendo UI Scheduler with ASP.NET MVC and Peta Poco
The example shed some light which the demo and documentation do not do, like for instance, the ViewModel they use in their example online:
C# ViewModel
public class Projection : ISchedulerEvent
{
public string Title { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string Description { get; set; }
public bool IsAllDay { get; set; }
public string Recurrence { get; set; }
public string RecurrenceRule { get; set; }
public string RecurrenceException { get; set; }
// Custom Field
public int EventId { get; set; }
public int CustomerId { get; set; }
}
Your ViewModel that you use for the Scheduler must inherit from the ISchedulerEvent class or it will not work correctly.
Razor View
The Razor View is pretty straight-forward, although most of the demos you run across will show data getting passed via the server-side (from the controller). Here, I'm doing this via Ajax methods (Create, Read, Update, Destroy).
#(Html.Kendo().Scheduler<KendoUISchedulerDemo.Models.Projection>()
.Name("scheduler")
.Date(DateTime.Today)
.Height(600)
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.EventId);
m.Field(f => f.Title);
m.Field(f => f.CustomerId);
m.Field(f => f.Description);
m.RecurrenceId(f => f.Recurrence);
})
.Read("Read", "Shared", new { Area = "Events" })
.Create("Create", "Shared", new { Area = "Events" })
.Destroy("Destroy", "Shared", new { Area = "Events" })
.Update("Update", "Shared", new { Area = "Events" })
)
.Events( events =>
{
events.Add("ABC.events.SchedulerAdd");
})
.Editable(edit =>
{
edit.TemplateId("schedulerTemplate");
})
)
The main point with using the datasource with ajax calls like above is that it allows us to put the methods in a separate controller so that we can keep the controller that is displaying the view clean.
Razor View - Kendo Template (for the pop-up editor of events)
This is the script block for the x-kendo-template that overwrites the default pop-up window when creating and editing events in the Kendo Scheduler. This script is pretty much the wild west and you can do whatever you want in it, and it is bound by default with the Kendo MVVM model. Take that with a grain of salt though because there is not a documented way to "extend" that ViewModel to properly put your datasources from custom drop down lists in the ASP.NET MVC wrapper (version) of the Scheduler. (This uses Twitter Bootstrap as well)
<script type="text/x-kendo-template" id="schedulerTemplate">
<div class="form-group">
<div class="col-md-5">
#Html.Label("title", "Title", new { #class = "col-md-2 control-label" })
<div class="col-md-10">
<input class="k-textbox" data-bind="value: title" />
</div>
</div>
</div>
<div class="form-group mTop10">
#Html.Label("CustomerId", "Customer", new { #class = "col-md-2 control-label" })
<div class="col-md-10">
<input id="CustomerId" class="w450" />
</div>
</div>
<div class="form-group mTop10">
<div class="left col-md-5">
#Html.Label("start", "Start", new { #class = "col-md-2 control-label left" })
<div class="col-md-10">
<input name="start" type="text" required data-type="date" data-role="datetimepicker" data-bind="value: start,invisible: isAllDay" />
<input name="start" type="text" required data-type="date" data-role="datepicker" data-bind="value: start,visible: isAllDay" />
</div>
</div>
<div class="left col-md-5">
#Html.Label("end", "End", new { #class = "col-md-2 control-label left" })
<div class="col-md-10">
<input name="end" type="text" required data-type="date" data-role="datetimepicker" data-bind="value: end ,invisible:isAllDay" />
<input name="end" type="text" required data-type="date" data-role="datepicker" data-bind="value: end ,visible:isAllDay" />
</div>
</div>
</div>
<div class="clear"></div>
<div class="form-group mTop10">
#Html.Label("isAllDay", "All Day", new { #class = "col-md-2 control-label" })
<div class="col-md-10">
<input type="checkbox" name="isAllDay" data-type="boolean" data-bind="checked:isAllDay">
</div>
</div>
</script>
JsonResults (in Controller)
Here are the CRUD Json Results. The Create, Update and Destroy JsonResults have been trimmed for the example.
public virtual JsonResult Read([DataSourceRequest] DataSourceRequest request)
{
var data = new List<Projection>();
data.Add(new Projection()
{
EventId = 1,
Start = DateTime.Now.AddDays(-2),
End = DateTime.Now.AddDays(-2).AddHours(2),
IsAllDay = false,
CustomerId = 1,
Description = "Booked for plumbing",
Title = "Manchester Residence"
});
return Json(data.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
public virtual JsonResult Create([DataSourceRequest] DataSourceRequest request, Projection evt)
{
if (ModelState.IsValid)
{
// Other code here
}
return Json(new[] { evt }.ToDataSourceResult(request, ModelState));
}
public virtual JsonResult Update([DataSourceRequest] DataSourceRequest request, Projection evt)
{
if (ModelState.IsValid)
{
// Other code here
}
return Json(new[] { evt }.ToDataSourceResult(request, ModelState));
}
public virtual JsonResult Destroy([DataSourceRequest] DataSourceRequest request, Projection evt)
{
if (ModelState.IsValid)
{
// Other code here
}
return Json(new[] { evt }.ToDataSourceResult(request, ModelState));
}
JavaScript
Here is the JavaScript contained within a stand alone JS file that corresponds to my "Add" event for the Scheduler. I didn't show the "Edit" event as it is pretty much the same idea and you should be able to figure it out.
ABC.Events.SchedulerAdd = function (e) {
function GetCustomers(value) {
var url = "/Events/Shared/GetCustomers"
var success = function (result) {
if (result != null) {
$("#CustomerId").kendoDropDownList({
dataTextField: "FullName",
dataValueField: "CustomerId",
dataSource: new kendo.data.DataSource({ data: result })
});
}
};
$.ajax({ url: url, success: success });
}
GetCustomers();
};
One of the keys in this JavaScript function is that we are turning our field into a Kendo DropDownList and wiring our datasource up at the same time that we are receiving as a JsonResult (not shown, but it's a simple Json object). Another key is how we wire up the datasource as we are creating a new kendo.data.DataSource. If you try to simply wire up the JsonResult, it won't work.
Conclusion
This is a work around to fill dropdownlists in a Scheduler Template (pop-up) when using the ASP.NET MVC Wrapper version of the Kendo UI. I am open for a better way, in which I imagine it will be adding the Json list data to the Internal MVVM that the Kendo Scheduler uses, but without the documentation for ASP.NET MVC or examples of how to pull it off, this is a way it can work.
EDIT #2 - Telerik ASP.NET MVC Example
I finally heard back from Telerik Support on this issue and was directed to this link: http://www.telerik.com/support/code-library/custom-editor-9fd60fca3c02 There is a sample MVC project there that shows how to use a Custom Editor, Drop Down Lists with datasources, all within ASP.NET MVC. Why on Earth there is no link from the documentation to such projects that can obviously help is a mystery to me.
Did you manage to figure this out? I'm working on something similar and have managed to get some of this to work and I have a demo that might help. Mine is not 100% right now but I am getting there. I have a custom template linked to a resource. My issue is sometimes the model doesn't validate so I don't get a post back to the Jason method in the controller. Have you seen this example?

Slideshow from ASP.net to SP2007

I have a task to convert the following ASP.Net slide show to SharePoint 2007 and I was wondering if any of you can offer some pointers how to do it most efficiently. My SP environment is a small farm SQL + Web/SP server. I've built a small handful of custom data driven web parts so I know how to develop and publish. What I'm having difficulties with, is the web service that this sample app uses and how to make it work in SP, specifically, how to access my custom list that contains the images that will vary in members.
Here is what the aspx file looks like:
<%# Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication3._Default" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
Slide Show Example
<div style="text-align: center;" >
<asp:Image ImageUrl="images/Slide1.JPG" ID="Image1" runat="server" alt="image" height="300" Width="450"/>
<br />
<asp:Button ID="prevButton" runat="server" Text="Prev" />
<asp:Button ID="playButton" runat="server" Text="Play" />
<asp:Button ID="nextButton" runat="server" Text="Next" />
<asp:SlideShowExtender
ID="SlideShowExtender1" runat="server"
TargetControlID="Image1"
SlideShowServiceMethod="GetSlides"
SlideShowServicePath="SlideShowService.asmx"
AutoPlay="true"
PlayInterval="4000"
NextButtonID="nextButton"
PlayButtonID="PlayButton"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="prevButton"
Loop="true" />
</div>
</p>
... and the webservice:
namespace WebApplication3
{
[WebService(Namespace = "http://microsoft.com/webservices/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService()]
public class SlideShowService : System.Web.Services.WebService
{
[WebMethod]
public AjaxControlToolkit.Slide[] GetSlides()
{
AjaxControlToolkit.Slide[] MySlides = new AjaxControlToolkit.Slide[10];
MySlides[0] = new AjaxControlToolkit.Slide("images/Slide1.JPG", "Slide1", "Slide1");
MySlides[1] = new AjaxControlToolkit.Slide("images/Slide2.JPG", "Slide2", "Slide2");
MySlides[2] = new AjaxControlToolkit.Slide("images/Slide3.JPG", "Slide3", "Slide3");
MySlides[3] = new AjaxControlToolkit.Slide("images/Slide4.JPG", "Slide4", "Slide4");
MySlides[4] = new AjaxControlToolkit.Slide("images/Slide5.JPG", "Slide5", "Slide5");
MySlides[5] = new AjaxControlToolkit.Slide("images/Slide6.JPG", "Slide6", "Slide6");
MySlides[6] = new AjaxControlToolkit.Slide("images/Slide7.JPG", "Slide7", "Slide7");
MySlides[7] = new AjaxControlToolkit.Slide("images/Slide8.JPG", "Slide8", "Slide8");
MySlides[8] = new AjaxControlToolkit.Slide("images/Slide9.JPG", "Slide9", "Slide9");
MySlides[9] = new AjaxControlToolkit.Slide("images/Slide10.JPG", "Slide10", "Slide10");
return MySlides;
}
}
}
Thanks in advance! Have nice day.
Risho