Click here to Skip to main content
15,898,134 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Multi-project solution with common DLLs Pin
vvincent12-Nov-10 11:27
vvincent12-Nov-10 11:27 
AnswerRe: Multi-project solution with common DLLs Pin
_Erik_12-Nov-10 6:38
_Erik_12-Nov-10 6:38 
QuestionStrangest problem with interop on Win7 client and .ocx control Pin
Jon_Boy12-Nov-10 3:38
Jon_Boy12-Nov-10 3:38 
AnswerRe: Strangest problem with interop on Win7 client and .ocx control Pin
Jon_Boy15-Nov-10 4:19
Jon_Boy15-Nov-10 4:19 
QuestionPublish the vb.net application for only one user Pin
vijay248211-Nov-10 19:56
vijay248211-Nov-10 19:56 
AnswerRe: Publish the vb.net application for only one user Pin
DaveAuld11-Nov-10 20:10
professionalDaveAuld11-Nov-10 20:10 
GeneralRe: Publish the vb.net application for only one user Pin
vijay248211-Nov-10 23:10
vijay248211-Nov-10 23:10 
QuestionSystem.Timers.Timer Event Handling with Web Message Box Pin
ggoutam711-Nov-10 18:09
ggoutam711-Nov-10 18:09 
Hello,

I am working on timeout web security function for my project.

I am using a web message box to display messages in web when the time elapsed.

The System.Timers.Timer function can work well at web, except the part where it calls the WebMsgBox from event.

Full coding as below :
<br />
Partial Class _Default<br />
    Inherits System.Web.UI.Page<br />
    Public aTimer_A As New System.Timers.Timer()<br />
<br />
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
        AddHandler aTimer_A.Elapsed, AddressOf OnTimedEvent<br />
        aTimer_A.Interval = 5000<br />
        aTimer_A.Enabled = True<br />
        WebMsgBox("Page loaded - can come out")<br />
    End Sub<br />
<br />
    Public Sub OnTimedEvent(ByVal source As Object, ByVal e As Timers.ElapsedEventArgs)<br />
        WebMsgBox("OnTimedEvent - does not come out")<br />
    End Sub<br />
<br />
    Public Sub WebMsgBox(ByVal sMsg As String)<br />
        Try<br />
            Dim sb As New StringBuilder()<br />
            Dim oFormObject As System.Web.UI.Control<br />
<br />
            sMsg = sMsg.Replace("'", "\'")<br />
            sMsg = sMsg.Replace(Chr(34), "\" & Chr(34))<br />
            sMsg = sMsg.Replace(vbCrLf, "\n")<br />
            sMsg = "<script language=javascript>alert(""" & sMsg & """)</script>"<br />
            sb = New StringBuilder()<br />
            sb.Append(sMsg)<br />
<br />
            For Each oFormObject In Me.Controls<br />
                If TypeOf oFormObject Is HtmlForm Then<br />
                    Exit For<br />
                End If<br />
            Next<br />
<br />
            oFormObject.Controls.AddAt(oFormObject.Controls.Count, New LiteralControl(sb.ToString()))<br />
        Catch ex As Exception<br />
<br />
        End Try<br />
    End Sub<br />
End Class<br />
<br />



Please advise. Your guidance on solving this problem is very much appreciated.

Thanks,
Goutam
AnswerRe: System.Timers.Timer Event Handling with Web Message Box Pin
Dave Kreskowiak12-Nov-10 3:40
mveDave Kreskowiak12-Nov-10 3:40 
GeneralRe: System.Timers.Timer Event Handling with Web Message Box Pin
ggoutam715-Nov-10 20:26
ggoutam715-Nov-10 20:26 
Questionprogam of checkbox Pin
Assinateq10-Nov-10 19:04
Assinateq10-Nov-10 19:04 
AnswerRe: progam of checkbox PinPopular
_Erik_11-Nov-10 1:24
_Erik_11-Nov-10 1:24 
GeneralRe: progam of checkbox Pin
Assinateq14-Nov-10 23:06
Assinateq14-Nov-10 23:06 
GeneralRe: progam of checkbox Pin
_Erik_15-Nov-10 5:30
_Erik_15-Nov-10 5:30 
GeneralRe: progam of checkbox Pin
Assinateq15-Nov-10 14:31
Assinateq15-Nov-10 14:31 
Questionlet captured temperature store in limited database slot and run in loop Pin
kun8510-Nov-10 19:00
kun8510-Nov-10 19:00 
AnswerRe: let captured temperature store in limited database slot and run in loop Pin
Luc Pattyn11-Nov-10 0:08
sitebuilderLuc Pattyn11-Nov-10 0:08 
AnswerRe: let captured temperature store in limited database slot and run in loop Pin
kun8511-Nov-10 16:02
kun8511-Nov-10 16:02 
QuestionEmbedded Resource xml help. [modified] Pin
crain198110-Nov-10 14:03
crain198110-Nov-10 14:03 
AnswerRe: Embedded Resource xml help. Pin
_Erik_11-Nov-10 1:16
_Erik_11-Nov-10 1:16 
GeneralRe: Embedded Resource xml help. Pin
crain198111-Nov-10 12:49
crain198111-Nov-10 12:49 
GeneralRe: Embedded Resource xml help. Pin
Dave Kreskowiak11-Nov-10 12:54
mveDave Kreskowiak11-Nov-10 12:54 
GeneralRe: Embedded Resource xml help. Pin
_Erik_11-Nov-10 13:20
_Erik_11-Nov-10 13:20 
GeneralRe: Embedded Resource xml help. Pin
crain198111-Nov-10 13:23
crain198111-Nov-10 13:23 
GeneralRe: Embedded Resource xml help. Pin
_Erik_11-Nov-10 13:58
_Erik_11-Nov-10 13:58 

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.