New Message on dotNET User Group Hyd

Display Alert for Client

Reply
  Recommend Message 5 in Discussion
From: silenceismyword

Hi,
 
Thanks for the message. But, I had done exactly the same. Still, I cant see the alert.
This is the code that I am using in the sub that is being called for the event "onClick" for Update Button
 
    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Dim drUserDetails As SqlDataReader
 
        If Session("roleid") = 1 Then
            iUserId = Request.QueryString("userid")
        Else
            iUserId = Session("userid")
        End If
 
        Try
            With New UsersSystem()
                drUserDetails = .checkUser(txtUName.Text.Trim(), iUserId)
            End With
        Catch exSql As SqlException
            Throw exSql
        End Try
 
        If (drUserDetails.Read()) Then
            If drUserDetails.Item("UserCnt") > 0 Then
                lblError.Text = "Invalid User Name...! Please select another User name and try again."
            ElseIf drUserDetails.Item("UserCnt") = 0 Then
                lblError.Text = ""
                ModUser(iUserId)
            End If
        Else
            lblError.Text = ""
            ModUser(iUserId)
        End If
    End Sub
 
    Private Sub ModUser(ByVal UserId As Int32)
        Dim htUser As New Hashtable()
        Dim iRetVal As Int32
        Dim ustatus As Int32
 
        If chkActive.Checked = True Then
            ustatus = 1
        Else
            ustatus = 0
        End If
        If txtUPwd.Text Is System.DBNull.Value Or txtUPwd.Text = "" Then
            txtUPwd.Text = pwd.Text
        End If
        htUser.Add("UserName", txtUName.Text.Trim())
        htUser.Add("Password", txtUPwd.Text.Trim())
        htUser.Add("RoleId", ddlRole.SelectedItem.Value)
        htUser.Add("CompanyName", txtCompanyName.Text.Trim())
        htUser.Add("Email", txtEmail.Text.Trim())
        Try
            With New UsersSystem()
                updateUser(htUser)
            End With
        Catch ex As Exception
            Throw ex
        End Try
 
        Dim strMessage As String
        strMessage = "The Record has been updated successfully."
 
        'finishes server processing, returns to client.
        Dim strScript As String = "<script language=_javascript_>"
        strScript += "alert('" & strMessage & "');"
        strScript += "</script>"
        Page.RegisterClientScriptBlock("ClientScript", strScript)
 
        Response.Redirect("/administrator/userslist.aspx")
    End Sub
 
Everything is working fine except that the alert is not displayed. Can anyone throw light on the error here?
 Please.. !
 
Regards
Kiran
 
New Message on dotNET User Group Hyd

Display Alert for Client

Reply
  Recommend Message 4 in Discussion
From: s_hashim

After Insertin/Updating the database
just put these over their it will pop a Alert box
 
Dim strJavaS As String
strJavaS = "<script language=" & "_javascript_" & ">"
strJavaS = strJavaS + "alert('Records Inserted/Updated Successfully');"
strJavaS = strJavaS + "</script>"
RegisterStartupScript("_javascript_s", strJavaS)
 

HTH
 

**********
Keep Smiling,
Regards.

Sayad Hashim Ali Kazi
Microsoft India Community Star.

SQL Star International Ltd.
SQL House, #13,Infocity,Madhapur,
Hyderabad 500 081.
Tel: +91-40-2310 1625(Off) +91-98491-29500(Cell)
www.mugh.net

-----Original Message-----
From: dotNET User Group Hyd [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 05, 2004 7:57 PM
To: dotNET User Group Hyd
Subject: Display Alert for Client

New Message on dotNET User Group Hyd

Display Alert for Client

Reply
  Recommend Message 1 in Discussion
From: silenceismyword

Hi Everyone,
 
I am new member and hence I am not aware whther any discussion on this topic has been done earlier. I am sorry if this is a repeating post, but, I need some help from u on this.
 
As a part of the requirement for the asp.net application I had been working on, we are required to display an alert to the client that records have been updated or inserted properly. This should take plae from the Code behind file, the class file for that particular page.
 
when I tried to display the same using REgisterClientScript, I  could not see the alert message. I tried REgisterStartpScipt also.
 
If anyone can help me out on this, that would be a great help.
 
Thanks and Regards
Kiran

View other groups in this category.


View other groups in this category.


View other groups in this category.

Click here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to