Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. alert message box return blank page

alert message box return blank page

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasetoolshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    C Coudou
    wrote on last edited by
    #1

    hi, i have a problem, why is it that the alert message returning a blank page behind. here is my function;

    Public Sub Alert(ByVal argMessage As String)
    sb = New StringBuilder
    sb.Append("<script>")
    sb.Append("alert('")
    sb.Append(argMessage)
    sb.Append("');")
    sb.Append("</script>")
    Page.ClientScript.RegisterStartupScript(Me.GetType(), "Message", sb.ToString())
    -- I've tried to change this into RegisterClientScriptBlock , but its the same result.
    End Sub

    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click

    .... my query here.....
    
       If ds.Tables(0).Rows.Count = 0 Then
                Me.Alert("No data found.pease search again.")
                Return  --> ' i tried to remove this, but its the same result.
        End If
    

    End Sub

    C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

    P 1 Reply Last reply
    0
    • C C Coudou

      hi, i have a problem, why is it that the alert message returning a blank page behind. here is my function;

      Public Sub Alert(ByVal argMessage As String)
      sb = New StringBuilder
      sb.Append("<script>")
      sb.Append("alert('")
      sb.Append(argMessage)
      sb.Append("');")
      sb.Append("</script>")
      Page.ClientScript.RegisterStartupScript(Me.GetType(), "Message", sb.ToString())
      -- I've tried to change this into RegisterClientScriptBlock , but its the same result.
      End Sub

      Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click

      .... my query here.....
      
         If ds.Tables(0).Rows.Count = 0 Then
                  Me.Alert("No data found.pease search again.")
                  Return  --> ' i tried to remove this, but its the same result.
          End If
      

      End Sub

      C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

      P Offline
      P Offline
      Prosanta Kundu online
      wrote on last edited by
      #2

      I have tried with your code and it is working fine. What exact problem you are facing? Try to put a breakpoint and debug it.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups