Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > PLEASE HELP.... ALERT PostBack

Reply
Thread Tools

PLEASE HELP.... ALERT PostBack

 
 
walterd
Guest
Posts: n/a
 
      04-22-2004
Hi All

Can someone please help me before I pull out all my hair? All my pages
inherit from PageBase class and I have the following code:

Public Shared Function CreateMessageAlert(ByRef aspxPage As
System.Web.UI.Page, ByVal strMessage As String, ByVal strKey As String)

Dim strScript As String = "<script language=JavaScript>alert('" & strMessage
& "')</script>"

If (Not aspxPage.IsStartupScriptRegistered(strKey)) Then

aspxPage.RegisterStartupScript(strKey, strScript)

End If

End Function

My problems is:

1. When I call the following function from an, say exception or
notification, the MessageBox appears on a BLANK Page, after clicking OK, the
page where the MessageBox was invoked from is displayed. It never displays
on the current page {

2. If I want to display a message and upon clicking OK, redirect the page to
another, the MessageBox never appears. Page redirect will happen and no
message will appear (

PLEASE HELP!!!!




 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      04-22-2004
just go ahead and pull your hair out...it aint worth it

....now that you are bald, let's take a look. if you want the message box to
appear ontop of the page, either use registerstartupscript or replace the
response.write portion to Page.Controls.Add(new LiteralControl("<script...


use attributes to post on condition. modify this code to post

Button1.Attributes.Add("onClick", "event.returnValue=confirm('Are you sure
you wish to delete the selected rate
deck?');document.body.style.cursor='wait';document .all.WaitState.style.display
= '';");
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"walterd" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All
>
> Can someone please help me before I pull out all my hair? All my pages
> inherit from PageBase class and I have the following code:
>
> Public Shared Function CreateMessageAlert(ByRef aspxPage As
> System.Web.UI.Page, ByVal strMessage As String, ByVal strKey As String)
>
> Dim strScript As String = "<script language=JavaScript>alert('" &
> strMessage
> & "')</script>"
>
> If (Not aspxPage.IsStartupScriptRegistered(strKey)) Then
>
> aspxPage.RegisterStartupScript(strKey, strScript)
>
> End If
>
> End Function
>
> My problems is:
>
> 1. When I call the following function from an, say exception or
> notification, the MessageBox appears on a BLANK Page, after clicking OK,
> the
> page where the MessageBox was invoked from is displayed. It never displays
> on the current page {
>
> 2. If I want to display a message and upon clicking OK, redirect the page
> to
> another, the MessageBox never appears. Page redirect will happen and no
> message will appear (
>
> PLEASE HELP!!!!
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alert..General Alert?..New Discovery?. =?Utf-8?B?U3BhbW1lcipLaWxsZXI=?= Wireless Networking 0 07-24-2007 03:36 PM
on click in popup window throws alert : need to avoid alert of postdata Ganesh ASP .Net 0 06-29-2007 06:51 AM
How to create a form Alert - Not using Alert Boxes Mersh Java 0 03-13-2007 04:14 PM
Can I raise a postback ? Session variable only visible after postback. Please help gce ASP .Net 2 05-08-2005 05:55 AM
ALERT: Virus Scam Alert! Toronto Garage Door Company Computer Support 1 11-18-2003 04:16 PM



Advertisments