By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,365 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,365 IT Pros & Developers. It's quick & easy.

grid view control

P: 17
I am developing a website(File system), in that I am using a grid view control. In the code behind file, I am using gridview control's rowDeleting event. When the user clicks delete button , I am displaying a messagebox asking whether to delete or not. When I am running from source it works fine.

But after publishing my website, from the published pages, when I click the delete button, I am getting the following error.

"showing a model dialog box or form when the application is not running in user interactive mode is not a valid operation. Specify the serviceNotification or DefaultDesktopOnly Style to display a notification from a service application."

How can I resolve this problem?

thank u all,
kiran
Nov 29 '07 #1
Share this Question
Share on Google+
4 Replies


Shashi Sadasivan
Expert 100+
P: 1,435
Hi,
what sort of modal dialog are you using?
javascript or .Net?

If its MessageBox.Show() then its from the .Net library and since your service is running the code, it would only run on the machine running the service (not the client)
Nov 29 '07 #2

P: 17
Hi,
what sort of modal dialog are you using?
javascript or .Net?

If its MessageBox.Show() then its from the .Net library and since your service is running the code, it would only run on the machine running the service (not the client)
I am using msgBox( ) function ( VBScript ).

in the gridView_rowDeleting event I used the following statements

Expand|Select|Wrap|Line Numbers
  1. dim style as msgBoxStyle
  2. dim msgResp as msgBoxResult
  3.  
  4. style = msgBoxStyle.DefaultButton2 or msgBoxStyle.crytical or msgBoxStyle.YesNo
  5.  
  6. msgResp = msgBox("want to delete?", style, "Delete")
  7.  
  8. if msgResp = msgBoxResult.yes then
  9.  
  10. '' Delete record
  11.  
  12. end if
  13.  
If this is not the right way to meet my requirement, I request u to show alternative. i.e., whenever user clicks the delete button of gridview control (I am using visual studio 2005), i want to receive confirmation from user.

Thank u all
kiran
Nov 29 '07 #3

P: 25
I am developing a website(File system), in that I am using a grid view control. In the code behind file, I am using gridview control's rowDeleting event. When the user clicks delete button , I am displaying a messagebox asking whether to delete or not. When I am running from source it works fine.

But after publishing my website, from the published pages, when I click the delete button, I am getting the following error.

"showing a model dialog box or form when the application is not running in user interactive mode is not a valid operation. Specify the serviceNotification or DefaultDesktopOnly Style to display a notification from a service application."

How can I resolve this problem?

thank u all,
kiran
can you post code ? or you to Project.com that more example

i think you should use code after
Expand|Select|Wrap|Line Numbers
  1. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  2.         {
  3.             if (e.Row.RowType == DataControlRowType.DataRow)
  4.             {
  5.                 LinkButton l = (LinkButton)e.Row.FindControl("LinkButton1");
  6.  
  7.                 l.Attributes.Add("onclick", "javascript:return " +
  8.                      "confirm('Bạn có thực sự muốn xóa bản ghi này ?  ')");
  9.             }     //DataBinder.Eval(e.Row.DataItem, "StatusID") + "')");
  10.         }
  11.  
  12.         protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
  13.         {
  14.             int statusID = (int)GridView1.DataKeys[e.RowIndex].Value;
  15.             Delete(statusID);// function Delete
  16.         }
Nov 29 '07 #4

P: 17
I tried with ur code. I used a templatedField with a linkbutton type Itemfield.
whem i am clicking the linkbutton it is diplaying alert but how can I fire to gridview_rowdeleting event when the user clicks "yes".
Dec 3 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.