Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 28 May 2008 19:47:37 +0200,    group: microsoft.public.dotnet.framework.aspnet.buildingcontrols        back       


writing ajax enabled custom server control   
Hi,

I found a piece of code where a textbox combined with a image url (looks 
like a month view) was AJAX enabled (with the CalendarExtender) . It works 
extremely well.
Just clicking on the image and a small calendar appeared on the web page. I 
want to use this code to create a custom server control which can use this 
feature. I would name this control txtDateField and will use it in a 
different customserver control which shows the record of any table in a 
database. But so created that depending of the fieldtype a textbox or 
combobox or my txtDatefield would be used. Believe it, it is simple when 
ready for the rest of the development proces. Here is the code:

        <b>Calendar with an associated button:</b><br />
        <asp:TextBox runat="server" ID="Date5" />
        <asp:Image runat="Server" ID="Image1" 
ImageUrl="Calendar_scheduleHS.png" /><br />
        <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" 
runat="server"
            TargetControlID="Date5"
            Format="d MMMM yyyy"
            PopupButtonID="Image1" />
        <div style="font-size: 90%"><em>(Click the image button to show the 
calendar; this calendar dismisses automatically when you choose a 
date)</em></div>
    </div>
Now on the webpage there is offcourse a scriptmanager. But how could this be 
fixed in a custom control. Any ideas?

I did found some answers in a different example: it was a mediaplay ajax 
enable button (just changed the button on clicking on it) But in stead of a 
normal customserver control this control was added tot the project as a 
class file. here is som code of this class:
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Collections.Generic

Namespace HDI.AJAX.Controls

  Public Class MediaPlayerButton
    Inherits Image
    Implements IScriptControl

    Private _playImageUrl As String
    Private _pauseImageUrl As String
    Private _scriptManager As ScriptManager

Now I'm trying to put these things together in the customservercontrol. But 
I receive an error on
"Implements IScriptControl" and
"Private _scriptManager As ScriptManager"

so how can i solve this

thank you very much

Ton
date: Wed, 28 May 2008 19:47:37 +0200   author:   ton

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us