I am creating Tridion GUI Extension, in this i have created a button (“InsertCP”) in the Ribbon toolbar.
The scenario is:
1.User selects any text from the Rich Text Box of the component
2.User clicks the “InsertCP” button from the ribbon toolbar.
3.when the user clicks the button , i am opening my custom aspx page.
4.From the custom aspx page, user can select “Component” and “Component Template”.
5.I am storing the selected component and component template tcm id in a variable.
6.I have submit button in the custom aspx page.
7.when the user clicks the submit button, i need to format the selected text as below in the Rich Text box source.
Ex:
<a href="componentid=tcm-00-000, componenttemplateid="tcm-00-000-00">Selected Text</a>
I have done upto the step 6, i am tryng the step 7, when i click the submit button am not able to submit the selected ID.

My ASPX page:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://www.sdltridion.com/web/ui/controls">
<head runat="server">
<title></title>
<cc:tridionmanager runat="server" editor="ExampleEditor" isstandaloneview="true">
<dependencies runat="server">
<dependency runat="server">Tridion.Web.UI.Editors.CME</dependency>
<dependency runat="server">Tridion.Web.UI.Editors.CME.Controls</dependency>
</dependencies>
</cc:tridionmanager>
</head>
<div>
<asp:TextBox ID="txttags" runat="server" Width="800px" ></asp:TextBox>
<asp:Button ID="btnsubmit" runat="server" Text="Submit" onclick="btnsubmit_Click" />
<c:button id="InsertButton" runat="server" class="customButton greybutton" label="Insert" />
</div>
Cs code :
protected void btnsubmit_Click(object sender, EventArgs e)
{
txttags.Text = "anyvalue.";
}
and java script are same as exiting one..
But i am getting error on runtime.Do i need to add any namespace in cs page.
My CS page will have so many events like below.Cant i use tridion control button for this page.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tridion.ContentManager.CoreService.Client;
using System.Xml.Linq;
using System.Xml;
namespace Somename
{
public partial class Classname
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ddSelectOption_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void lbPublication_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void lbPubFolders_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void lbComponent_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void lbComponentTemplate_SelectedIndexChanged(object sender, EventArgs e)
{
}
I’ll provide a second answer to your updated question, although you are still keeping us a bit in the dark since you only mention you get a runtime error and not what that exactly is (it is impossible for me to provide a good answer if I don’t know what error you get).
Your ASPX page should look something like this:
Note: the table markup is copied directly from the Anchor popup, feel free to use divs instead and style them any way you want, the example is meant to show you how to reuse the existing Tridion controls
Your CS would then become:
It doesn’t contain anything, and it doesn’t need to, as all the actions you will be doing in your JavaScript as explained before.