I have a c# I am writing and I can not figure out how to properly put the entire function in the c#. I know I can put it in a .js and call it, however, there are two images in it that are being called from the database and will change for each while. I believe the best place to put this is in my sql connection call.
What it comes down to is being able to run my javascript function directly in the c#.
Here is how I thought it might work and correct me where I am wrong please:
ScriptManager.RegisterStartupScript(this,GetType(),"function","function();",true);
(function()
{
blah blah blah
});
This is all tucked in to the void Page_Load within my SqlConnection argument... Or I may be way off and not able to put javascript in line. I appreciate the insight. Thanks