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 3597796
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:09:48+00:00 2026-05-18T20:09:48+00:00

I have a ASP.NET 4 page and I am using tinyMce. My aim is

  • 0

I have a ASP.NET 4 page and I am using tinyMce.

My aim is to change toolbar setting for tinyMce depending on “Role” associated to logged User.

To solve it my idea is to include different version of tinyMce JavaScript code using some logic.

My questions are:
– do you know a better solution?
– how to include JavaScript inside the Head of the page pro grammatically?

Thanks

  • 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-18T20:09:49+00:00Added an answer on May 18, 2026 at 8:09 pm

    It sounds as if you’re not using MVC with MasterPages (which has a built in method for including such a JavaScript). If you’re using web forms, you can put a Literal in the head of your document and assign its text value from the code behind:

    <asp:Literal ID="myTinyMCEScript" runat="server" />
    
    ...
    
    string adminScriptText = "some javascript to format for admins";
    string userScriptText = "some javascript to format for knuckledraggers";
    this.myTinyMCEScript.Text = (myUserRole == "admin") ? adminScriptText : userScriptText
    

    Not terribly elegant, but effective.

    Edit:

    To use a file:

    string adminScript = "<script language=\"javascript\" type=\"text\\javascript\" src=\"link/to/adminscript.js\"></script>";
    string userScript = "<script language=\"javascript\" type=\"text\\javascript\" src=\"link/to/userscript.js\"></script>";
    

    Since you want to store it in a file, and javascript is run in plain text at the browser, you might as well just stick it in a js file and include that js file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET 4 page and I am using tinyMce. My aim is
I have a pretty simple ASP.NET MVC page and am using TinyMCE to allow
I have a ASP.Net page using ADO to query MS access database and as
I have an asp.net web page written in C#. Using some javascript I popup
I'm working on an ASP.NET page, using VB.NET and I have this hierarchy: Page
I have an asp.net web page that has a TinyMCE box. Users can format
I have an ASP.NET page using the AJAX control toolkit for some controls. A
I have a COM object embeded in ASP.NET page using <object classid=clsid:XXX...> . It
Well i have a asp.net page where i have a button that im using
I have a ASP.NET page with an asp:button that is not visible. I can't

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.