Re: RegisterStartupScript cannot work.

From: RickDee (chang-gin_dee_at_agilent.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 11:05:26 +0800

Steven Cheng,

I am so sorry. I found the problem already. With the previous mail that I
sent which has all the code inside, I found that at the event property of
the button, at the Click Event there, I actually called the Button1_Click
"again". That is why "Hello" came out twice.

I am so sorry.

Thanks
Regards.

*********************

"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:UhITAe7vEHA.2692@cpmsftngxa10.phx.gbl...
> Hi Rick,
>
> Thanks for your reply. As for the further issue you mentioned, I've also
> done some tests but seems haven't reproduct it on my side. Is there any
> change in your page? Also, I've modified the code behind's Page_Load event
> as following:
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> if(!IsPostBack)
> btnPost.Attributes["onclick"] = "if(!confirm('Are you sure to post back
> the page?')){return false;}";
> }
>
> You may try the above method and test again.
>
> In addition, you can also try put a normal html <input type=button..>
> (html input button) and test the script code, just like :
>
> <INPUT id="htmlButton" type="button" value="Delete"
> onclick="if(!confirm('Are you sure to delete?')){return false;}" >
>
> Put it directly in the aspx page template and run the page to see whether
> this works.
>
> Hope helps. Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>