Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2007, 08:51 AM
Registered User
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem calling RegisterStartupScript.

Hi,

I need to populate a javascript message box on saving data from the Gridview to the database. I'm calling the RegisterStartupScript in the RowUpdating event as shown below. The result of the function call is captured in a hidden label. But the problem is the Javascript function Confirmation is called after the entire GridView1_RowUpdating() is executed. I wanted the result of the confirmation message based on that, the changes will be saved into the database. Any help? Thanks in advance


 protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        Page.RegisterStartupScript("Confirmation", "<script language='javascript'>Confirmation('Save')</script>");

        if (label1.Text == true)
        {
             // Code for Saving changes.
        }
        // Do something else.
    }





 
Old January 14th, 2008, 03:52 AM
Registered User
 
Join Date: Jan 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Raajagopal.v Send a message via MSN to Raajagopal.v Send a message via Yahoo to Raajagopal.v
Default

hi greetings !
        instead of using
"<script language='javascript'>Confirmation('Save')</script>");

change this and check it off

"<script language='javascript'>Confirm('Save')</script>");

at your service
&nbsp;&nbsp;&nbsp;-v.raajagopal





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in calling classes in simple Servlet sanna231 J2EE 6 December 23rd, 2012 01:06 AM
Page.RegisterStartupScript shanwaj ASP.NET 2.0 Basics 4 October 6th, 2008 01:46 AM
Page.ClientScript.RegisterStartupScript & Threads VerbatimBOT ASP.NET 2.0 Professional 0 July 23rd, 2008 05:39 AM
Problem calling a script from IE kwilliams General .NET 1 February 1st, 2006 04:37 PM
RegisterStartupScript - Postback from script gp_mk General .NET 4 April 14th, 2004 05:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.