Register client script question

H

Hardy Wang

Hi,
By calling Page.RegisterClientScriptBlock, the JavaScript will be
generated right after VIEWSTATE hidden field. Is there a way I can register
my script to end of page instead beginning?
 
K

Kevin Spencer

Not sure why you feel the need to, but RegisterStartupScript puts the script
just before the </form> tag.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
H

Hardy Wang

My script is registered just after VIEWSTATE hidden value.

The reason I am doing so is ValidationSummary won't popup alert box if one
of the validator is server side (sadly, I have to go to server side). So I
am thinking of a walk-around. My idea is to build a function to detect each
validator's status, grab the error message of thoese invalid, I will
concatenate messages to form a JavaScript, then I register this script to
client.
But just as what I said above, this piece of code appears in top of HTML
code, probably because I am doing this in a ASCX control
(Page.RegisterClientScriptBlock). Until user click OK button of dialog, the
whole page will not show up, so I am thinking of moving this thing to
bottom, let page finished loading, then call JavaScript.
 
K

Kevin Spencer

Good heavens!

I think you might have a much easier time if you did your own validation.
That's what we do here. It's not particularly hard to do, if you're any good
at JavaScript!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top