display alert from code behind
-
Hi! I am trying to display alert from code behind. below are my code description. Dim strScript As String strScript = "<script>" strScript = strScript & "alert('please select a value');" strScript = strScript & "</script>" Page.ClientScript.RegisterStartupScript(Me.GetType, "ClientScript", strScript.ToString()) the alert gets displayed fine but everything in the main page disappears. could someone please help me . thanks
-
Hi! I am trying to display alert from code behind. below are my code description. Dim strScript As String strScript = "<script>" strScript = strScript & "alert('please select a value');" strScript = strScript & "</script>" Page.ClientScript.RegisterStartupScript(Me.GetType, "ClientScript", strScript.ToString()) the alert gets displayed fine but everything in the main page disappears. could someone please help me . thanks
Hi, If you want to show alert messages on button click then in pageload event write button1.attributes.add("onclick","return showalert()"); and in the aspx page write a javascript function to get the alert messages. Reply me if it doesn't work for you. Bhanu
-
Hi, If you want to show alert messages on button click then in pageload event write button1.attributes.add("onclick","return showalert()"); and in the aspx page write a javascript function to get the alert messages. Reply me if it doesn't work for you. Bhanu
the link button i have is in the datalist. so when i write above it doesn't fires in first click but it does fires if i click second time. below are my codes. Private Sub dlParent_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles dlParent.ItemCommand If e.CommandName = "select" Then Session("MenuId") = e.CommandArgument.ToString End If Dim menuHead As LinkButton = CType(e.Item.FindControl("lnkParent"), LinkButton) If menuHead.Text = "Property View" Then If Session("locationid") <> Nothing Then Response.Redirect("PropertyDetail.aspx") Else menuHead.attributes.add("onclick","return displayalert()");---this doesnt work in first click End If ElseIf menuHead.Text = "Portfolio View" Then Response.Redirect("PortfolioCapex.aspx") End If End Sub