Finally i found some solution about how to call function from aspx page, couze i needed to make dynamic urls.
Im searching on Google for several weeks, but i didnt found how to make dynamic routing depend of current locale like:
site.com/en/home - when CurrentCulture is en-EN and
site.com/fr/home - When CurrentCulture is fr-FR.
I found one solution where i call function from aspx, to check CurrentCulture and print a string.
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="System.Threading" %>
<script runat="server">
void Demo() {
CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
string ime = currentCulture.ToString();
Response.Write(ime);
}</script>
and on same aspx page i have
<a href="<% Demo(); %>/default.aspx">CLICK</a>
But now i have problem with my “Move JavaScript at bottom of page, after form tag” Class. On debug mode, i noticed that
protected override void Render(HtmlTextWriter writer)
where my class is, runs before Demo() function….
ANY suggestion ?
Instead of directly calling
Response.Writein your function, have it return a string and out put that where needed.If you simply need to call the function, you can discard the result. You can the call the function from the overridden
Renderfunction:Functions:
Markup: