C# - Get TinyMCE Instance By Class?
Jan 24, 2011
I have a form with multiple TinyMCE instance. I created the TextArea controls dynamically using a Repeater control - They all have the same ID,but I gave each one a different class. I assigned each of the TextArea controls a TinyMCE instance using the editor_selector : option in the TinyMCE Init function.
tinyMCE.init({ mode : 'textareas',theme : 'simple',editor_selector : 'upperBlock',directionality : 'rtl'}); tinyMCE.init({ mode : 'textareas',theme : 'simple',editor_selector : 'middleBlock',directionality : 'rtl'});
I want to refer to a specific TinyMCE instance in a JS function and get its content. In the case when each TextArea control has a different id that could by done by using :
tinyMCE.get('IdOfYourTextBoxWithTheTinyMCEContent').getContent()
Is there a way to get ref to a specific TinyMCE instance content by the class assigned to it in the editor_selector option of the TinyMCE Init function ?
View 2 Replies
Similar Messages:
Jun 30, 2010
I have a class instance which is created by using Activator.CreateInstance() method. That class instance contains helper methods which are frequently used throughout the application. In order to avoid creating the instance multiple times, I'm just thinking about implementing an appropriate caching mechanism. The following consideration should be taken into account:
1) I can't use static class and methods.
2) There are around 6 instances (1 instance per class) per App Domain.
View 4 Replies
Sep 15, 2010
Suppose we declare and define the variable in one class let say FirstClass and we want to use that variable in another class let say SecondClass which is outside of FirstClass .how to do this?
View 2 Replies
Apr 4, 2011
A instance of a class is created in the partial class of an aspx page.Under page_load or button click method I'm trying to set the value to the class. but when each postback takes place new instance is created and I'm losing the previous value.
public partial class DatabaseSelection : System.Web.UI.Page
{
DBProperties dbpro;
Metadata obmeta;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
dbpro = new DBProperties();
}
View 4 Replies
Jan 27, 2010
I've a class that hold all the necessary properties. I want to pass the instance of that class in RedirectToAction. Right now, I can pass the instance but the action to which it redirect, doesn't receive that same instance. The target action has new instance of class.
eg.
AbcFilter a = new AbcFilter();
a.ABCname="abc";
RedirectToAction("AbcAction",a);
Public ActionResult AbcAction(AbcFilter a)
{// this method receives the "a" as new instance, but not the same that I pass in RedirectToAction
}
View 3 Replies
May 21, 2010
I wanna do smth like this:
[Code]....
Does anyone have a recommendation how this is archievable? I am trying to pass in the Type to the method and then create an instace of it and then access the properties in it.
View 8 Replies
Apr 16, 2010
I am trying to create instance of class by using reflection in ASP.net web site. Class ClassName is defined and located in App_code folder. Following line returns null, what could be wrong.
Type type = Type.GetType("NameSpace.ClassName", false, true);
View 5 Replies
Mar 31, 2010
I am trying to compile the following code and i am getting the error:
Cannot create instance of abstract class .
m_objExcel = new Excel.Application();
m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;
m_objBook = (Excel._Workbook)(m_objBooks.Add(m_objOpt));
m_objSheets = (Excel.Sheets)m_objBook.Worksheets;
m_objSheet = (Excel._Worksheet)(m_objSheets.get_Item(1));
// Create an array for the headers and add it to cells A1:C1.
object[] objHeaders = {"Order ID", "Amount", "Tax"};
m_objRange = m_objSheet.get_Range("A1", "C1");
m_objRange.Value = objHeaders;
m_objFont = m_objRange.Font;
m_objFont.Bold=true;
// Create an array with 3 columns and 100 rows and add it to
// the worksheet starting at cell A2.
object[,] objData = new Object[100,3];
Random rdm = new Random((int)DateTime.Now.Ticks);
double nOrderAmt, nTax;
for(int r=0;r<100;r++)
{
objData[r,0] = "ORD" + r.ToString("0000");
nOrderAmt = rdm.Next(1000);
objData[r,1] = nOrderAmt.ToString("c");
nTax = nOrderAmt*0.07;
objData[r,2] = nTax.ToString("c");
}
m_objRange = m_objSheet.get_Range("A2", m_objOpt);
m_objRange = m_objRange.get_Resize(100,3);
m_objRange.Value = objData;
// Save the Workbook and quit Excel.
m_objBook.SaveAs(m_strSampleFolder + "Book2.xls", m_objOpt, m_objOpt,
m_objOpt, m_objOpt, m_objOpt, Excel.XlSaveAsAccessMode.xlNoChange,
m_objOpt, m_objOpt, m_objOpt, m_objOpt);
m_objBook.Close(false, m_objOpt, m_objOpt);
m_objExcel.Quit();
View 2 Replies
Jul 29, 2010
I want to send a class instance to my Web Service(ASP.NET - C#). How can I do?
View 1 Replies
Dec 12, 2010
Error 1279 Cannot create an instance of the abstract class or interface 'System.Web.Mvc.FileResult'
[Code]....
I am using MVC 2. The same code works in my onather application. I have no idea about this error.
View 2 Replies
Nov 9, 2010
I have a public shared function and I'm trying to access the values of a text box and a session variable.
I'm getting the error "Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class."
Is there any way I can get to the values in the textboxes or session variables from within the method?
[code]....
View 2 Replies
Mar 22, 2010
Basic question - is it possible to access the current Page from a static class in ASP.NET?
I am thinking no, as google turns up no results.
View 3 Replies
Nov 25, 2010
I have a class that inherited from object type and has some string properties, also I have a report(.rdcl) that use the fields of that class.I add a webpage in my project, then I drag a reportviewer component into it. then I set the report to my existing report mentioned before using choose report (small arrow). in my page load code behind, I create an instance of that class and now, I don't have any idea how to bind that data.
View 1 Replies
Dec 7, 2010
I am using the Ajax AutoCompleteExtender control, and employing a public shared function to act as a web service without actually creating a web service. This approach works perfectly, however I would like to take this one step further and filter my query from a drop down list, however I am unable to accomplish this. Whenever I attempt to reference the drop down list from within the public funtion, I get:
"cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class."
I have found very limited documentation on resolving this error. Pretty much every solution includes removing the shared reference instead of handling it.
When I remove the Shared reference and just make it private, the AutoCompleteExtender ceases to function completely (i.e. functions a a regular textbox). Here is my code:
If you notice that I am not referencing the @YRQ parameter in my query, that is intentional. I will replace the subquery with that parameter when I am able to get this working.
View 2 Replies
May 12, 2010
I've a requirement where i need to pass some objects across the pages. So i created a custom class with all the properties required and created a instance of it and assigned all the properties appropriately. I then put that object in the session and took it the other page. The problem is that even when i set the properties values to the class it is coming as null. I set a breakpoint in the getter-setter and saw that the value itself is coming as null.
public class GetDataSetForReports
{
private Table m_aspTable;
private int m_reportID;
private string m_accountKey;
private string m_siteKey;
private string m_imUserName;
/// <summary>
/// Asp Table containing the filters
/// </summary>
public Table aspTable
{
get
{
return m_aspTable;
}
set
{
m_aspTable = aspTable;
}
}
/// <summary>
/// Report ID
/// </summary>
public int reportID
{
get
{
return m_reportID;
}
set
{
m_reportID = reportID;
}
}
/// <summary>
/// All the accounts selected
/// </summary>
public string accountKey
{
get
{
return m_accountKey;
}
set
{
m_accountKey = accountKey;
}
}
/// <summary>
/// All the sites selected
/// </summary>
public string siteKey
{
get
{
return m_siteKey;
}
set
{
m_siteKey = siteKey;
}
}
/// <summary>
/// Current User Name
/// </summary>
public string imUserName
{
get
{
return m_imUserName;
}
set
{
m_imUserName = imUserName;
}
}
}
This is how i'm creating an instance in the page1 and trying to get it in the page2. Page1 Code
//Add the objects to the GetDataSetForReports Class
GetDataSetForReports oGetDSForReports = new GetDataSetForReports();
oGetDSForReports.aspTable = aspTable;
oGetDSForReports.reportID = iReportID;
oGetDSForReports.accountKey = AccountKey;
oGetDSForReports.siteKey = Sitekey;
oGetDSForReports.imUserName = this.imUserName.ToString();
But the values are not getting set at all. The values are not passing to the class (to the setter) at all. Am i making any OOP blunder?
View 1 Replies
Jan 21, 2011
I'm new to web dev. and I'm using asp.net/C# to build a website. I currently have a class called DataLayer that I'm using to perform all of my database functions, and also store some queried information. I initially had this class as static, because that's how I wanted it to behave, but then realized that will be all kinds of bad for multiple users.
I have to make an instance out of this class in order to use it, but I need to maintain the same instance throughout several webpages for that user. Any thoughts or ideas on how to go about this approach? How to pass this object from page to page? Store in session variable, as a global object somehow?
View 2 Replies
Apr 8, 2010
Can I access a class instance declared on the master page from a content page?
View 4 Replies
Feb 6, 2010
vs asp2008 instance cant recognize the sqlExpress 2008 instance on my machine
I have wonder if you could try to help me with the fallowing issue:When trying to add a new sql server connection (local or remount) from VS(visual studio) 2008 express - on the add connection dialog
box: server name: are Empty!!
The vs couldn't point to any database, like dont recognize the sqlExpress 2008 instance i got on my machine.
1. Have tried to "play" with sa property's(from sqlS: Databases: security: login tree folder) and with the sql
s windows service: stop and restart
2. And so with the target db.
3.
On the services.msc
The sql server express the status is started.
The sql server agent status is disabled and don't have the option to start.
The sql server explorer status is disabled and don't have the option to start.
4. And so reinstalled the asp.
View 2 Replies
Nov 17, 2010
I am trying to include the .Net TinyMCE dll in my project. The code I am using is:
<%@ Register Assembly="Moxiecode.TinyMCE" Namespace="Moxiecode.TinyMCE.Web" tagprefix="tinymce" %>
I have already added the dll to the references in the project and I checked the code in my csproj to make sure it is correct. I modified it to make sure it had a path hint.
<Reference Include="Moxiecode.TinyMCE, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>binMoxiecode.TinyMCE.dll</HintPath>
[code]...
View 1 Replies
Aug 17, 2010
When I click a button that causes a postback on the UpdatePanel it calls the tinyMCE.triggerSave().
It reloads the panel and the editor show up again, but when I try to call tinyMCE.triggerSave() the second time I get the following error:
g.win.document is null
I though it was getting the old instance, but I'm also removing the control (tinyMCE.execCommand('mceRemoveControl',false,'Editor');) after I call the save. Even so it still crashes the second time.
View 1 Replies
Nov 2, 2010
The source tags inside my video element need to be self closing so the iPad doesn't start whinging.
I type in <source src="myVideo.m4v" />
TinyMCE keeps changing it to <source src="myVideo.m4v" ></source> though.
How can I tell it to stop?
View 1 Replies
Feb 7, 2010
i am using TinyMCE AND AsyncFileUpload AND an Update Panel After Uploading , i cannot delete the Images while Adding them to tinymce content because it is being used by another process.
lock (this)
{
if (File.Exists(_FILE_HANDLER_))
{
File.Delete(_FILE_HANDLER_);
}
}
Do i have to Dispose TinyMce :: Like This :
tinyMCE.execCommand('mceFocus', false, '<%= TextBox1.ClientID %>');
tinyMCE.execCommand('mceRemoveControl', false, '<%= TextBox1.ClientID %>');
View 1 Replies
Nov 9, 2010
I have a web-site. We are using TinyMCE as our text editor. I just upgraded to the newest version and added the media plugin so our users can add videos to their enteries.The upgrade works great on Chrome, FireFox, IE7. However, it does not work with IE8. The frame around the editor disappears along with the toolbar.
Here is the init code I'm using:
tinyMCE.init({
// General options[code].....
View 1 Replies
Jun 22, 2010
I have tinymce .net control on my .net webform and the basic setup works a treat. My code behind can see the html generated my tinymce via the TextArea1.Value property. However as soon as I set the mode to textareas the value is suddenly always empty! The problem is that if the mode is not set to textareas the tinymce editor is only in simple mode and does not offer all the features.
How do I get this to work?
View 10 Replies
May 7, 2015
I used tinymce in my page...
I want users don't allow to resize it so I used below css:
.elm
{ direction:rtl;
resize:none;
text-align:right;
height:180px;
font:bold 18px tahoma;
}
but it doesn't work..
is there other code for this?
View 1 Replies