.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to display a prompt message from gridview_deleting event

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
Hello, i am following a code example to prompt user before delete and have a reference to the commandfield Delete linkbutton.But something is missing because nothing happen when executed.  Gridview1_Deleting linkBtn.OnClientClick = "return confirm('Are you sure you want to delete this entry?');" end sub <Columns>                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />

View Complete Post

More Related Resource Links

SPUtility.TransferToErrorPage("My Message") not allowed to attach any controls event.

Hi, I have created a custom error page and update it using to webApplication using following code: WebApplication.UpdateMappedPage(SPWebApplicaton.SPCustomPage.Error, CustomErrorPage) My error page contains one link button and onClick event, I have to perform some operations. As I click on the button Error is occurred and onClick event code didn't execute. If I render custom error page by providing url in IE like http://myweburl/_layouts/myerrorpage then every thing is working fine i.e. every event is working fine. Also If I use SPUtility.Redirect() method instead of SPUtility.TransferToErrorPage() then also every thing is working fine. My error message is as follow in case of SPUtility.TransferToErrorPage(): Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. StackTrace is [HttpException (0x80004005): Unable to validate data.]    System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +10988853    System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +295 [ViewStateException: Invalid viewstate. Client IP: fe80::8960:150e:cf5d:2e17%11 Port: 53192 User-Agent: Mozill

How to get SPPageStatusSetter to actually display a status message

I have a event listener running on a list, with several possible conditions.  I want to use the status bar to update the user as a case happens.  I thought, that since the code is a event reciever/listener, that this would be considered server side code, and to make something appear on the status bar, I can use the SPPageStatusSetter.AddStatus method to show the message.  Yet, when I put in the method parameters, nothign  happens. (I did a statusbar= new SPpageStatusSetter(), statusbar.AddStatus("caller", "messgae", Yellow)) What am I missing?  Is this not considered server-side code, and I should use the other mechanism to set the status bar?  or? thanks rsRocky Sanders

Anonymous Access to "Event Export" on sharepoint calendar display page

I am using a SharePoint calendar with events added in the list. When an anonymous user tries to use "Export Event" on the display page ,the user is prompted for a login. Is there a way that an anonymous user can download the .ics file without logging in ? Is anonymous access even possible ?    

Event Handle & Declared Message Errors

Hi Experts: There is a missing event Handle that requires a variable found in the button code . Secondly,  there is a Name declared error (i.e., Name 'First' is not declared, Name 'Last' is not declared, Name 'City' is not declared, Name 'State' is not declared) found in the page code. How do we revise the codes to remove the message errors? Go to the following URL link to view 'High Res' screen shots at http://cforedu.com/screen.pdf Here is the page code:<%@ Page Language="VB" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script runat="server"> Protected Sub Save(sender As Object, e As EventArgs) Dim First As TextBox = TryCast(Me.fvApplication.FindControl("First"), TextBox) Dim Last As TextBox = TryCast(Me.fvApplication.FindControl("Last"), TextBox) Dim City As TextBox = TryCast(Me.fvApplication.FindControl("City"), TextBox) Dim State As TextBox = TryCast(Me.fvApplication.FindControl("State"), TextBox) End Sub </script> </head> <body> <form id="form1" runat="server"> <div> <asp:FormView runat="server" ID="fvApplicatio

Display HoverMenuExtender Using a Click Event

I need to display HoverMenuExtender using a Click Event. Can you explain in detail how to use this code from this old thread: http://forums.asp.net/t/1489596.aspx    

Display Message

I want to display message such that when user fill register form, and after compliting all fields a message i.e Record Inserted Successfully. plz help me out....

How to display pop up message in SSRS 2005?

Hi Guys, I have two parameters : 1. ReportType (with values - Manager, Supervisor, ALL) 2. EnterID (should enter manually) Normally, the intention of my report is when the user selects ReportType as ALL, they should enter in EnterID as ALL But for some reason, when the user selects ReportType as ALL and he enters the EnterID as value 100 or 200 or some number, the report is showing incorrect results. Now, what I want is When the user selects ReportType as 'ALL'  and if he enters anynumber other than ALL, I would like to see a pop up message displaying saying 'Please type ALL'. Is this Possible?

Pop-up message in event handler

Hi All, I am writing a item insert validation in "ItemAdding Event" of event handelr. After validating the page is redirecting to the error page showing the custom error message. My requirement is ... Instead of moving to the error page the custom error should display in a pop-up dialog box on the same page. If I will click on the ok than the page should not redirect to any where(the focus should be in the same page) and the value in the field should not reset. Please help me..

Event receiver validation client message


Is thera a way to display a client message if validation sets. (java script or inline validation error message)

properties.Status = SPEventReceiverStatus.CancelWithError;

properties.Cancel =



properties.ErrorMessage =


Display confirm message using javascript after user successful logs in



I need to display a javascript confirm box after the user successfully logs into the application. If the select 'yes'  of the confirm box then I need to navigate them to a different page and if they select 'no' the default.aspx page should be displayed. I am using the login control.

I tried to use ClientScript. RegisterClientScriptBlock on Login1_Authenticate event, it didn't work. I tried the same thing on the Page_Load event of Default.aspx as well as Master Page load event, that also didnt work.

How can this be accomplished? Need a quick resolution.



Message Display Problem



I am facing a  strange problem .i use following code for show successfully message to user.so it is working fine but problem is when I go another page and came back same page again  through  browser back button again successful message display.

For example suppose there are two page i.e one.aspx nad two.aspx.  i  save one.aspx record then message display me that "Record Insert Sucessfully!!" then I go to two.aspx and when I came back again one.aspx by browser back button again same message are display again

please someone help me.

Script for message

ClientScript.RegisterStartupScript(Me.GetType(), "alert", "<script language='javascript'>alert('Record Updated Sucessfully..')</script>")

Use like

Public Sub SAVEDATA()



            MYTRANS = myConnection.BeginTransaction()






Display "Successfully Inserted" Message on the same form/page


I have a page setup that i would like to add a message when the record was successfully inserted. My button event code is as follows:

dac.insertAccessPointintosql(ddlAP, txtIP, ddlAPType, ddlAPFreq, ddlAPBand, txtLoc, txtUser, txtPass);

This works great and inserts, but would like to provide confirmation without having to send to another page.


Custom Message onbeforeunload event.


Hello All,


I need to prompt user when he/she leave from page without save changes.

I had achieved that thing but the problem is that

it displays it own message I need to display my message only.

So I have used onbeforeunload event in javascript.

Please give me snip code if possible so that I can find solution easily.


The Code that I had written is,


function SetDirty() {




window.onbeforeunload = closeIt;

How do i display a custom message when my ListBox is empty?


I've got a ListBox. Its ItemsSource is Data-Bound to a Dataset.

When there are entries in the Dataset, the ListBox displays them, and it doesn't look so bad.

The ListBox is big, so when its empty it looks weird on the Window.

What i want to do is to display a custom mesasge somewhere inside the listbox(maybe in the center) if there is nothing to display. But i've had no luck sofar.

How could i go about achieving this?

Display a message if query returns no data


I added a text box to my report reading: "No Data Matches Search Criteria".  I tried to add a visibility expression: =iif((Rownumber("SalesCube")=0),1,0)

I get "The Hidden expression usied...returned a data type that is not valid"

What am I doing wrong???


Failure Message Object WSS_Content_MyActiveSite failed in event OnBackup




Hey Guys,

I am hoping you can help me with my backup issues.  I am currently trying to run a backup and I keep getting the same error message (whether it is a full, farm, or differential).


For this example I am just trying to backup my active site and i get the following error message.


Object WSS_Content_MyActiveSite failed in event OnBackup. For more information, see the spbackup.log or sprestore.log file located in the backup directory


when I check the log, i get the following information:


10/6/2010 1:36:35 PM] Verbose: Starting OnBackup event.
[10/6/2010 1:36:35 PM] Verbose: Starting object: SharePoint - My Active Site.
[10/6/2010 1:36:36 PM] Verbose: Starting object: WSS_Content_MyActiveSite.
[10/6/2010 1:36:36 PM] Progress: [SharePoint - My Active Site] 50 percent complete.
[10/6/2010 1:36:36 PM] Verbose: Starting object: job-workflow-failover.
[10/6/2010 1:36:38 PM] Progress: [job-workflow-failover] 50 percent complete.
[10/6/2010 1:36:38 PM] Verbose: [WSS_Content_MyActiveSite] SQL Server Connection String: Data Source=SV03MIS017\SHP1;Initial Catalog=WSS_Content_MyActiveSite;Integrated Security=True;Enlist=False;Connect Timeout=15.
[10/6/2010 1:36:38 PM] Verbose: Starting object: ExpirationProcessing.

Display Progress Message


I want to display Progress message like

Please wait page is loading..............

How can i achieve this

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend