TinyMCE / Ajax Postback Problem


Posted on 16th Feb 2014 07:03 pm by admin

Hiya all,

I have a page which loads the TinyMCE editor. On the postback I obviously want to fetch that data again but the value stays empty. Strangely enough, when I disable the "updatepanel" control I do get the value. Now, this leaves me puzzled.Here's the code (c# from code behind) for the page that reads and writes the TinyMCE text:1 private Question _question;
2 3 protected Question Question
4 {
5 get {
6 if(_question == null)
7 _question = GuiLayer.SelectQuestion(Convert.ToInt32(Request.QueryString["id"].ToString()));
8 return _question;
9 }
10 }
11
12 protected void Page_Load(object sender, EventArgs e)
13 {
14 if (!Page.IsPostBack)
15 {
16 txtTekst.Text = Server.HtmlDecode(Question.AnswerPrefab);
17 DataBind();
18 }
19 }
20 21 protected void btnsaveQuestion_Click(object sender, EventArgs e)
22 {
23 if (Page.IsValid)
24 {
25 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "init", "InitTiny();", true);
26 Question.AnswerPrefab = Server.HtmlEncode(txtTekst.Text);
27 GuiLayer.UpdateQuestion(_question);
28 }
29 }
Here's the corresponding asp.net page: 1
2
3
23

ManageQuestion


24


25

26
27
28
29
30


any help would be appreciated

No comments posted yet

Your Answer:

Login to answer
108 Like 8 Dislike
Previous forums Next forums
Other forums

Undefined offset
The following script checks to see if the user answer matches the correct answer.

Form Fiel

Hashing?
Hi, I was hoping to take a string value then convert it - consistently - across each of our pages in

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

How to refresh a parent page from a modal popup
Hi,I have a modal popup in which I need to upload a file and store in the database should give a mes

Do While statement
hi guys,

This may sound trivial but im new to php and as part of an assignmenti have to const

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv

Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash