How to embed MarvinSkatch in aspx page?

User 22c88daf92

06-09-2013 06:50:02

hello!


Our project need to draw structure or reaction in C# aspx page, but we can't find any example about  how ro embed MarvinSkatch or MarvinApplet in aspx file,


Is there some code in c# (aspx) ? thanks!

ChemAxon 2c555f5717

06-09-2013 11:41:57

Dear Iamyang!


You can find examples if you download and install JChem for .Net in %JChem_Install_Dir%\Examples\ChemAxonASPSamples.doc. Basicly you only have to insert the HTML's that can be seen in applet examples, like this:



public override void RenderControl(HtmlTextWriter writer)
{
writer.AddAttribute("type", "text/javascript");
writer.RenderBeginTag(HtmlTextWriterTag.Script);
writer.Write(string.Format("msketch_name = '{0}';", this.ID));
writer.Write(
string.Format("msketch_begin({0}, {1}, {2});", ResolveClientUrl(this.AppletPath).EncloseInApostrophes(), this.Width, this.Height));
writer.Write("msketch_end();");
if (this.SetMoleculeOnLoad)
{
writer.Write(this.GetOnloadScript());
}
writer.RenderEndTag();
base.RenderControl(writer);
}

I hope it helps.


 


Regards:
Balázs