Click here to Skip to main content
15,927,914 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Learning programming using VB.NET Pin
Christian Graus26-May-05 11:27
protectorChristian Graus26-May-05 11:27 
GeneralVB6 Pin
Anonymous25-May-05 10:04
Anonymous25-May-05 10:04 
GeneralProblem Installing Visual Basic 6.0 Pin
buffbuh25-May-05 7:17
buffbuh25-May-05 7:17 
GeneralRe: Problem Installing Visual Basic 6.0 Pin
progload25-May-05 7:43
progload25-May-05 7:43 
GeneralRe: Problem Installing Visual Basic 6.0 Pin
Dave Kreskowiak25-May-05 8:51
mveDave Kreskowiak25-May-05 8:51 
GeneralRe: Problem Installing Visual Basic 6.0 Pin
buffbuh26-May-05 11:58
buffbuh26-May-05 11:58 
GeneralRe: Problem Installing Visual Basic 6.0 Pin
Dave Kreskowiak27-May-05 2:16
mveDave Kreskowiak27-May-05 2:16 
Generalcustom control Pin
RyanEwing7625-May-05 6:32
RyanEwing7625-May-05 6:32 
I am trying to create an iframe server control that has a src that can be set in code behind, and also that checks to see if the client has changed the src and control will maintain the current src on postback. Here is my code:

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel

Namespace IMCControl
<defaultproperty("src"), _
="" toolboxdata("<{0}:iframe="" runat="server">")> _
Public Class IMCIFrame
Inherits System.Web.UI.WebControls.WebControl
Implements INamingContainer
Implements IPostBackDataHandler

#Region " Windows Form Designer generated code "

'UserControl overrides dispose to clean up the component list.


'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container
End Sub

#End Region
Private m_src As String = String.Empty
Public changed As EventHandler

Public Sub New()
MyBase.New(HtmlTextWriterTag.Iframe)
End Sub
<bindable(true), category("navigation"),="" defaultvalue("")=""> _
Public Property [src]() As String
Get
If Not viewstate("IFsrc") Is Nothing Then
m_src = viewstate("IFsrc")
End If
Return m_src
End Get
Set(ByVal Value As String)
viewstate("IFsrc") = Value
End Set
End Property

Protected Overrides Sub RenderContents(ByVal writer As System.Web.UI.HtmlTextWriter)
MyBase.RenderContents(writer)
End Sub

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
If Me.src = String.Empty Then Exit Sub
MyBase.Render(writer)
End Sub

Protected Overrides Sub AddAttributesToRender(ByVal writer As System.Web.UI.HtmlTextWriter)
writer.AddAttribute(HtmlTextWriterAttribute.Src, src)
MyBase.AddAttributesToRender(writer)
End Sub

Public Overridable Sub RaisePostDataChangedEvent() Implements IPostBackDataHandler.RaisePostDataChangedEvent
OnChange(EventArgs.Empty)
End Sub

Public Overridable Function LoadPostData(ByVal postdata As String, ByVal collection As Collections.Specialized.NameValueCollection) As Boolean Implements IPostBackDataHandler.LoadPostData
Dim origval As String = src()
Dim postedval As String = collection(postdata)
If origval = String.Empty Or origval <> postedval Then
src = postedval
Return True
Else
Return False
End If
End Function
Sub OnChange(ByVal e As EventArgs)
If Not changed Is Nothing Then
changed(Me, e)
End If
End Sub
End Class
End Namespace

My problem is that the IPostBackDataHandler subs and functions don't fire. and the only src that the iframe remembers is the one initially set on code behind, and any subsequent changes to the src property made on the client (by javascript) are lost on postback. PLEASE HELP!!! Any and all comments are appreicated!
QuestionHow to check tiff file Compression.. Pin
KRathor25-May-05 4:22
KRathor25-May-05 4:22 
AnswerRe: How to check tiff file Compression.. Pin
Anonymous25-May-05 11:50
Anonymous25-May-05 11:50 
GeneralPreview a word document from access Pin
thetuxpenguin25-May-05 3:32
thetuxpenguin25-May-05 3:32 
GeneralRe: Preview a word document from access Pin
jonathan1525-May-05 3:49
jonathan1525-May-05 3:49 
GeneralRe: Preview a word document from access Pin
thetuxpenguin25-May-05 4:12
thetuxpenguin25-May-05 4:12 
GeneralRe: Preview a word document from access Pin
jonathan1525-May-05 4:16
jonathan1525-May-05 4:16 
GeneralRe: Preview a word document from access Pin
thetuxpenguin25-May-05 4:19
thetuxpenguin25-May-05 4:19 
GeneralRe: Preview a word document from access Pin
jonathan1525-May-05 4:33
jonathan1525-May-05 4:33 
GeneralRe: Preview a word document from access Pin
thetuxpenguin25-May-05 4:37
thetuxpenguin25-May-05 4:37 
GeneralRe: Preview a word document from access Pin
thetuxpenguin25-May-05 4:57
thetuxpenguin25-May-05 4:57 
GeneralRe: Preview a word document from access Pin
Anonymous26-May-05 1:11
Anonymous26-May-05 1:11 
GeneralDeleting a Positon in an array Pin
harrysk25-May-05 1:29
harrysk25-May-05 1:29 
GeneralRe: Deleting a Positon in an array Pin
toxcct25-May-05 1:42
toxcct25-May-05 1:42 
GeneralRe: Deleting a Positon in an array Pin
harrysk25-May-05 2:27
harrysk25-May-05 2:27 
GeneralRe: Deleting a Positon in an array Pin
rudy.net25-May-05 3:31
rudy.net25-May-05 3:31 
GeneralRe: Deleting a Positon in an array Pin
harrysk25-May-05 3:49
harrysk25-May-05 3:49 
GeneralRe: Deleting a Positon in an array Pin
rudy.net25-May-05 4:11
rudy.net25-May-05 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.