So in my aspx mark up, I have a script tag. in this tag, I would like to set the src property in the code-behind (will be getting this value from web.config)
So here is what I did:
in the aspx page, I have my script tag:
<script type="text/javascript" src="<%=someUrl%>"></script>
And in the aspx.cs, I have:
protected string someUrl { get; set; }
as a class level var, and then I have:
protected override void OnPreRender(EventArgs e)
{
someUrl = "https://myurl.com/file?id=SCRIPTID";
base.OnPreRender(e);
}
Is this a good way to go about it? It seems to be working. Thanks!

New Topic/Question
Reply




MultiQuote




|