RegisterScriptBlock - Can Script Blocks Be Read / Accessed?

M

Michael A. Vickers

Hi,

Does anybody have a method by which they can read script blocks that have been
registered via RegisterScriptBlock or RegisterStartupScript? I'd like to
manipulate registered script blocks prior to them being rendered to the
client.

Thank you.


Michael
 
K

Kevin Spencer

I'd like to put a stamp on my envelope after I've mailed it. Unfortunately
for both of us, that isn't possible. What you CAN do is manipulate the
string that the RegisterClientScriptBlock method is going to register prior
to registering it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
B

bruce barker

no. but on your base page, you can override it with one that does.

string mClientStartupScript = new NameValueCollection();

public string GetClientScriptBlock(string key)
{
return mClientStartupScript[key];
}
public override void RegisterClientScriptBlock(string key, string script)
{
mClientStartupScript[key] = script;
base.RegisterClientScriptBlock(key, script);
}



| Hi,
|
| Does anybody have a method by which they can read script blocks that have
been
| registered via RegisterScriptBlock or RegisterStartupScript? I'd like to
| manipulate registered script blocks prior to them being rendered to the
| client.
|
| Thank you.
|
|
| Michael
|
| --
| Have a round and remember things we did that weren't so tender,
| Let the train blow the whistle when I go... -JC
 
M

Michael A. Vickers

no. but on your base page, you can override it with one that does.

Brilliant. That was so simple I'm ashamed I didn't think of that myself. Thank
you very much.


Michael
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top