Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6951583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:14:17+00:00 2026-05-27T14:14:17+00:00

Finally i found some solution about how to call function from aspx page, couze

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:14:18+00:00Added an answer on May 27, 2026 at 2:14 pm

    Instead of directly calling Response.Write in 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 Render function:

    Functions:

    public string Demo() {
    
        CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
    
        string ime = currentCulture.ToString();
    
        return ime;
    }
    
    protected override void Render(HtmlTextWriter writer)
    {
      Demo();
      // rest of code
    }
    

    Markup:

    // .NET 4.0
    <a href="<%: Demo() %>/default.aspx">CLICK</a>
    
    // .NET < 4.0
    <a href="<%= Demo() %>/default.aspx">CLICK</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I finally found some resources and a solution. I will share it here.
Big Update : As I finally found the real solution, I also discovered the
I spend some days to search solution about this trouble : I have an
I finally found out the difference between UTC and GMT by making the effort
I've finally found a client for my hosted software - the first time I've
I've finally found a way to debug classic asp code in visual studio 2008
I found out recently that JList (finally!) was generified in JDK7. Why JTree and
I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager
I finally let windows nag me into upgrading from IE6 to 8. Now in
I'm finally set up to be able to work from home via VPN (using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.