which control in vs08 aspx c# will be able to take html tags as input and display it formatted accor

Posted by user287745 on Stack Overflow See other posts from Stack Overflow or by user287745
Published on 2010-05-29T09:23:10Z Indexed on 2010/05/29 9:32 UTC
Read the original article Hit count: 310

Filed under:
|
|
|

i asked a few questions regarding this and got answers that indicate i will have to make an costum build editor using ,markdown, .... to achieve something like stackoverflow.com/questions/ask page.

there is time limitation and the requirements are that much,

i have to achieve

1) allow users to using html tags when giving input 2) save that complete input to sql db 3) display the data in db withing a contol which renders the formatting as the tags specify.

i am aware label and literal controls support html tags,

the problem is how to allow the user to input

the textbox does not seem the support html tags?

thank you

Need help in implementing the affect of the WRITE A NEW POST On stackoverflow.com <%--The editor--%>

<asp:UpdatePanel ID="UpdatePanel7" runat="server">
    <ContentTemplate>

<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>    


<div id="textchanging"  onkeyup="textoftextbox('TextBox3'); return false;">

<asp:TextBox ID="TextBox3" runat="server" CausesValidation="True" 


></asp:TextBox>

</div>




<%-- OnTextChanged="textoftextbox('TextBox3'); return false;"
gives too man literals error.
--%>


<asp:Button ID="Button6" runat="server" Text="Post The Comment, The New, Write on Wall" 
onclick="Button6_Click"  />



<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>


<asp:TextBox ID="TextBox4" runat="server" CausesValidation="True"></asp:TextBox>   

<asp:Literal ID="Literal2" runat="server" Text="this must change"



here comes the div

<div id="displayingarea" runat="server">This area will change</div> 

    </ContentTemplate>
</asp:UpdatePanel>


 <%--The editor ends--%>

protected void Button6_Click(object sender, EventArgs e) { Label3.Text = displayingarea.InnerHtml; }

As you see, I have implemented the effect of typing text in textbox which appears as a reflection in the div WITH FULLY FORMATTED TEXT ACCORDIG TO THE HTML TAGS USED

The textbox does not allow html! Well the text box doesnot have too, script just extracts what is typed, within letting the server know.

The html of the div tag also changes as typed in textbox.

Now,

There is a “post” button within an update plane a avoid full post back of page

What I needis when the button is clicked on the value withing the div tag “innerhtml” is passed on to the label.

Yes I know the chnages are only made on the client side,

So when the button click event occurs the server is not aware of the new data within the div tag,

Therefore the server assign the original html withing the div to the lab.

Need help to overcome this,

How is it that what we enter text in the textbox press the button with coding like label1.text=textbox1.text; and it works even in update panel, but the aabove code for extracting innerhtml typed at users end similar to yping in textbox does not work?

© Stack Overflow or respective owner

Related posts about c#

Related posts about html