grid view control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • universe
    New Member
    • Oct 2007
    • 17

    grid view control

    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 serviceNotifica tion or DefaultDesktopO nly Style to display a notification from a service application."

    How can I resolve this problem?

    thank u all,
    kiran
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    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)

    Comment

    • universe
      New Member
      • Oct 2007
      • 17

      #3
      Originally posted by Shashi Sadasivan
      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_rowDel eting event I used the following statements

      Code:
      dim style as msgBoxStyle
      dim msgResp as msgBoxResult
      
      style = msgBoxStyle.DefaultButton2 or msgBoxStyle.crytical or msgBoxStyle.YesNo
      
      msgResp = msgBox("want to delete?", style, "Delete")
      
      if msgResp = msgBoxResult.yes then
      
      '' Delete record
      
      end if
      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

      Comment

      • nguyenlh
        New Member
        • Mar 2007
        • 25

        #4
        Originally posted by universe
        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 serviceNotifica tion or DefaultDesktopO nly 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
        [CODE=vbnet]protected void GridView1_RowDa taBound(object sender, GridViewRowEven tArgs e)
        {
        if (e.Row.RowType == DataControlRowT ype.DataRow)
        {
        LinkButton l = (LinkButton)e.R ow.FindControl( "LinkButton 1");

        l.Attributes.Ad d("onclick", "javascript:ret urn " +
        "confirm('B ạn có thực sự muĂ´́n xóa bản ghi này ? ')");
        } //DataBinder.Eval (e.Row.DataItem , "StatusID") + "')");
        }

        protected void GridView1_RowDe leting(object sender, GridViewDeleteE ventArgs e)
        {
        int statusID = (int)GridView1. DataKeys[e.RowIndex].Value;
        Delete(statusID );// function Delete
        }[/CODE]
        Last edited by Shashi Sadasivan; Nov 29 '07, 10:14 PM. Reason: adding code tags

        Comment

        • universe
          New Member
          • Oct 2007
          • 17

          #5
          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_rowdel eting event when the user clicks "yes".

          Comment

          Working...