Re: remove a script registered with RegisterStartupScript
- From: "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 12:54:52 -0400
I didn't say to call it twice. You only need to call it once. Why on earth
would you want to have your app execute an instruction that you don't intend
for it to follow? That is what you're asking. In essence, you are saying, "I
tell my app to insert this script, and I want to know how to tell it
afterwards to insert a different script, rather than the one I already told
it to insert." Instead, you should determine which script you really want to
insert, and tell it to insert that one. Once.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Ahmed" <Ahmed@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E14F0B67-FF52-490F-AB0E-1D4DA9C2E3D8@xxxxxxxxxxxxxxxx
> Actually this's not exactly what happens when u call the
> RegisterStartupScript twice.
> If u called it twice, only the first call will appear. the second one
> (which
> is intended to replace the first one) won't be registered when the same
> key
> is used.
>
> I found another work around for my problem, but I am really interested to
> find a solution for this problem.
>
> "Kevin Spencer" wrote:
>
>> This question is a bit confusing. The RegisterStartupScript method takes
>> a
>> string and adds it to the page as a startup script, by inserting it at
>> the
>> bottom of the form. You say you want to "replace" it. Now, as it is only
>> "placed" when you call the method, all you have to do is use a different
>> script string when you call the method. Assuming you only call the method
>> one time, and pass only one string to it, whichever string you pass to it
>> will be the one placed in the Page.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> Ambiguity has a certain quality to it.
>>
>> "Ahmed" <Ahmed@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:62D8BB40-5BA6-46DD-97E3-108ADEC98340@xxxxxxxxxxxxxxxx
>> > Hi all,
>> > Is there any way to replace a script I registered in Page Load with the
>> > method Page.RegisterStartupScript
>>
>>
>>
.
- Follow-Ups:
- References:
- remove a script registered with RegisterStartupScript
- From: Ahmed
- Re: remove a script registered with RegisterStartupScript
- From: Kevin Spencer
- Re: remove a script registered with RegisterStartupScript
- From: Ahmed
- remove a script registered with RegisterStartupScript
- Prev by Date: Re: Using MS Word on server
- Next by Date: DA DataMapping Problem
- Previous by thread: Re: remove a script registered with RegisterStartupScript
- Next by thread: Re: remove a script registered with RegisterStartupScript
- Index(es):
Relevant Pages
|