Alright, so here's the dilemma you're facing.
Just to clarify, when you use that command, it simply inserts some script into the webpage and sends it to the client side.
There are two ways to tackle this issue. You can combine both function calls into one, like so:
ScriptManager.RegisterStartupScript(This.Page, Page.GetType,
"text", "test1();test2();", True)
Alternatively, you can do it like this:
ScriptManager.RegisterStartupScript(This.Page, Page.GetType, "text", "test1();", True)
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "text2", "test2();", True)
Make sure to give a new "key" name - if you skip this step, the second one will overwrite the first one.
However, even doing this won't cut it:
ScriptManager.RegisterStartupScript(this.Page, Page.GetType, "text", "test1()", True)
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "text2", "test2()", True)
Notice the missing ";" after the function.
So,
Test1() - only works for one
Test1(); - will work if you add more
If you omit the trailing ";", then the script gets injected as:
Test1()Test2()
However, what you actually need is:
Test1();Test2();
Therefore, either include both calls in a single script inject like this:
Test1();Test2();
Or if you prefer using two separate script inject calls?
Ensure that you have unique key names for each, and also remember to add the trailing ";" so that they are recognized as distinct JavaScript function calls.