Page 1 of 1

Any integration example using ASP.Net ?

PostPosted: Mon Jul 06, 2009 12:32 pm
by Pierre B
Hello,

Does anyone have an integration example using ASP.Net 2.0 +

I can't get it work with such platform.

Regards

Re: Any integration example using ASP.Net ?

PostPosted: Wed Jul 22, 2009 1:01 pm
by gudski
Hi,

I assume you're having problem of getting the value from your textarea upon posting (postback) and the trick is to add the css-class "wymupdate" to your submit button.
Here's a simple example of how you get it to work:

First of you need to reference the script:
Code: Select all
<head>
   <script type="text/javascript" src="/Scripts/jquery.min.js"></script>
   <script type="text/javascript" src="/Scripts/wymeditor/jquery.wymeditor.min.js"></script>
</head>


Put this in your aspx or ascx:
Code: Select all
<script type="text/javascript">
    jQuery(document).ready(function()
    {
        jQuery('#<%= myTextarea.ClientID %>').wymeditor();
    });
</script>
<textarea runat="server" id="myTextarea" name="myTextarea" ></textarea>
<asp:Button runat="server" ID="myButton" CssClass="wymupdate" OnClick="myButton_Click" Text="Save" />
<asp:Label runat="server" ID="Result" />


And in code-behind we print the value from the editor to verify that it works:
Code: Select all
protected void myButton_Click(object sender, EventArgs e)
{
   Result.Text = myTextarea.Value;
}


Regards,
Daniel

Re: Any integration example using ASP.Net ?

PostPosted: Thu Jul 23, 2009 3:01 pm
by Trumbun
Hi, David thanks for you replay but I am still having Problems. The Interface isn't loading in my asp.net page

Code: Select all
    <script src="/wymeditor/jquery.wymeditor.min.js" type="text/javascript"></script>
    <script type="/text/javascript" src="jquery/jquery.js"></script>

    <script type="text/javascript">
    jQuery(document).ready(function()
    {
        jQuery('#<%= myTextarea.ClientID %>').wymeditor();
    });
    </script>


</head>
<body>
    <form id="form1" runat="server">
    <div>
        <textarea runat="server" id="myTextarea" name="myTextarea" ></textarea>
        <asp:Button runat="server" ID="myButton" CssClass="wymupdate" OnClick="myButton_Click" Text="Save" />
        <asp:Label runat="server" ID="Result" />
    </div>
    </form>


That is my code but the editor is not showing.

Re: Any integration example using ASP.Net ?

PostPosted: Fri May 28, 2010 10:14 am
by jamesjohn09
Thanks gudski. I was also looking for the same. Thanks for helping us.