Hi
I am new to asp 2.0 i am looking for sample code in Vb that demonstrates client Call back in asp 2.0.
Also i am looking for RichTexBox control in asp 2.0 nothing fancy just a control that can understand rtf.
This question should not be asked here. It should be asked in the General Discussion Forum for ASP.NET 2.0.
However, check this link:
ASP.NET 2.0 CallBack
Shoot -- I've been having problems with connectivity on my server.
Here's the code. Code-behind for the page:
Partial Class CallBack_DB_aspx Implements System.Web.UI.ICallbackEventHandler
Protected ZipTable As Hashtable Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) _ Handles Me.Load ZipTable = New Hashtable() ZipTable.Add("98106", "Seattle") ZipTable.Add("10270", "New York") ZipTable.Add("95110", "San Jose")
Dim cbReference As String = Page.GetCallbackEventReference(Me, _ "arg", "GetServerData", "context") Dim callbackScript As String = "" callbackScript &= "function CallTheServer(arg, context)" callbackScript &= vbCrLf & "{" callbackScript &= vbCrLf & " " & cbReference & ";" callbackScript &= vbCrLf & "}" Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _ "CallTheServer", callbackScript, True) End Sub
Public Function RaiseCallbackEvent(ByVal eventArgument As String) _ As String Implements _ System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent Dim city As String If ZipTable(eventArgument) Is Nothing Then city = "Not found" Else city = ZipTable(eventArgument).ToString() End If Return city End Function End Class
Be careful. The example shown works for Beta 2 but not for later releases. Microsoft changed the ICallbackEventHandler interface. See
http://west-wind.com/weblog/posts/2694.aspx.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
abahramiasp
Member
15 Points
19 Posts
Sample ASP.net 2.0' Client callback
Aug 24, 2005 11:34 PM|LINK
Hi
I am new to asp 2.0 i am looking for sample code in Vb that demonstrates client Call back in asp 2.0.
Also i am looking for RichTexBox control in asp 2.0 nothing fancy just a control that can understand rtf.
Any help will be appreciated
Thanks
Al
haidar_bilal
All-Star
45607 Points
8728 Posts
MVP
Re: Sample ASP.net 2.0' Client callback
Aug 25, 2005 05:32 AM|LINK
However, check this link: ASP.NET 2.0 CallBack
regards
mikepope
Contributor
5776 Points
1155 Posts
AspNetTeam
Microsoft
Moderator
Re: Sample ASP.net 2.0' Client callback
Aug 25, 2005 05:34 AM|LINK
http://mikepope.com/blog/DisplayBlog.aspx?permalink=731
Also:
http://weblogs.asp.net/coltk/archive/2004/06/27/167079.aspx#FeedBack
http://msdn.microsoft.com/msdnmag/issues/04/08/CuttingEdge/default.aspx
Nothing for you on the RichTextBox, tho.
ASP.NET User Education
This posting is provided "AS IS" with no warranties, and confers no rights.
abahramiasp
Member
15 Points
19 Posts
Re: Sample ASP.net 2.0' Client callback
Aug 26, 2005 03:17 AM|LINK
Thanks, the first link wasnt working for me and unfortunately none of the sample works with Beta 2. is there a working sample code out there?
mikepope
Contributor
5776 Points
1155 Posts
AspNetTeam
Microsoft
Moderator
Re: Sample ASP.net 2.0' Client callback
Aug 26, 2005 04:57 AM|LINK
Here's the code. Code-behind for the page:
Here's the page:
ASP.NET User Education
This posting is provided "AS IS" with no warranties, and confers no rights.
PLBlum
All-Star
30389 Points
5347 Posts
MVP
Re: Sample ASP.net 2.0' Client callback
Aug 26, 2005 02:20 PM|LINK
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com