Text Templating

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
3/19/2011 3:20:26 AM
Gravatar
Total Posts 9

Text Templating

Table table1 = new Table();
                table1.EnableViewState = false;

row = new TableRow(); cell = new TableCell();
                    cell.Controls.Add(myLabel); row.Cells.Add(cell);

                    switch (item.FieldType)
                    {
                        case "TrueFalse":     
                            CheckBox myCheckBox = new CheckBox();
                            myCheckBox.ID = "myControls" + item.FieldID.ToString();
                            // FieldsPanel.Controls.Add(myCheckBox);
                            cell = new TableCell();
                            cell.Controls.Add(myCheckBox); 
                            row.Cells.Add(cell);
                            break;

....

At the top i can create and doing postback by dynamic fields.
First i create a label in a cell , then creating corresponding control near it.

 

now i need to render control in a HTML text template ..

Template string :

 <TABLE>
<TR><TD> Name : </TD> <TD> [%Name%]</TD>
</TR>
</TABLE>

How can i say render a textbox that replaces with [%Name%] string

and handle post back...

 

I am trying with "Control.RenderControl Method" filed to put tuely

and how to handle post back ?

i know this is not about mojoportal but any help  would be great

 

thnks from now.

kanpinar

 

3/24/2011 10:21:16 AM
Gravatar
Total Posts 9

Re: Text Templating

Aciklama : [%Açıklama:LongText;False;5:%]


With Regex.Replace and Control.Rendercontrol

[% Tag Name : Tag Type ; Properties : Value %]

its ok. now.

thnks.

3/24/2011 11:59:22 AM
Gravatar
Total Posts 18439

Re: Text Templating

why don't you just use one of the built in controls that render as a table such as GridView? seems like you are re-inventing the wheel.

when you hard code html you should make it lower case else it will not be valid xhtml

html tables are not meant for layout, only for displaying tabular data. If you are displaying tabular data you should use <asp:GridView or <portal:mojoGridView

 

if you are not displaying tabular data you should not use html tables.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.