•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 426,013 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,601 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 811 | Replies: 3 | Solved
![]() |
•
•
Join Date: Jun 2008
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
hey folks,
I've got a problem. I created a function that creates a javascript alert. it works fine for the invalid date call, but not for the updated call. I have used this function on several other projects and have had no problems with it until now. If stepped through the debugger and it hits the call, it goes through the js function, but no alert comes up. any ideas?
function that creates js alert
I've got a problem. I created a function that creates a javascript alert. it works fine for the invalid date call, but not for the updated call. I have used this function on several other projects and have had no problems with it until now. If stepped through the debugger and it hits the call, it goes through the js function, but no alert comes up. any ideas?
Private Sub btnChg_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnChg.Click
Dim objEmployee As New Employee.Business.Employee(CInt(Request.QueryString("id")))
Dim objemployee2 As New Employee.Business.Employee(cboSup.SelectedItem.Value)
If Not txtStartDate.Text = "" And Not txtStartDate.Text = " " Then
If IsDate(txtStartDate.Text) Then
objEmployee.StartDate = txtStartDate.Text
Else
scriptAlert("InvalidDate", "Start Date is Invalid")
Exit Sub
End If
Else
objEmployee.StartDate = Null.NullDate
End If
'uneccesary code removed
If objEmployee.Update() Then
scriptAlert("Updated", txtFName.Text + " " + txtLName.Text + "'s record has been updated.")
Else
scriptAlert("NotUpdated", txtFName.Text + " " + txtLName.Text + "'s record could not be updated.\nPlease check your values.")
End If
Response.Redirect("EmployeeListing.aspx")
End Subfunction that creates js alert
Private Sub scriptAlert(ByVal key As String, ByVal message As String)
Dim scriptKey As String = key
Dim javaScript As String = "<script type='text/javascript' language=""JavaScript"">alert(""" + message + """);</script>"
ClientScript.RegisterClientScriptBlock(Me.GetType(), scriptKey, javaScript)
End Sub Last edited by Oreo1982 : Jul 18th, 2008 at 9:48 am.
•
•
Join Date: Jun 2008
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
I wondered about that at first, but I've added other alerts to that same function that work properly. Pop up blockers wouldn't block one but not the other.. right? wouldn't they block all of them?
•
•
Join Date: Jun 2008
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
I've figured out that is is the response.redirect that is causing the problem. as soon as i comment out that line. it works fine. I'm not sure why it is causing problems. I've tried server.transfer instead of response.redirect and it too prevents the alert from coming up. Any ideas on how to have that alert come up right before i go to the next page?
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age ajax amd asp avatar blue gene business chips code custom database developer development dos economy energy enterprise environment hardware ibm ibm. news intel ibm it javascript linux medicine memory microsoft msdn news office open source openoffice pc ps3 recession red hat remote working russia skin sun supercomputer supercomputing technology theme trends ubuntu vista working x86
Other Threads in the ASP.NET Forum
- Previous Thread: asp.net
- Next Thread: How to Dynamic Events / Controls in ASP.NEt C#


Linear Mode