I'm using the User Control method of embedding contour forms into our site (ASP.NET not MVC), and am trying to access the PageCssClass values rather than how they are written out to the tag using the literal now. Is there a way to access the classnames or do I have to write a parser to derive them from the Literal's text field?
if (!string.IsNullOrEmpty(caption))
{
string retval = caption;
//if the caption starts with a number this would cause invalid xml,
//so adding a n before the number fixes that
if (Char.IsNumber(retval.Substring(0, 1).ToCharArray()[0]))
retval = "n" + retval;
retval = Regex.Replace(retval, @"\W*", "").ToLower();
return retval;
}
else
return string.Empty;
}
Looks like you're doing your own parsing as well. Either way I'd end up having to parse something. Might just be easier to parse out the markup: class="([^"]+)".
Just in case, formService.CurrentPage is found how? That would be a local member variable to your API right? What does it represent?
Tim, do you you have any documentation on extending Contour ASCX UI as you have provided for the Razor implementation? I've successfully extended the RenderForm.ascx control but am not finding a lot of documentation on modifying the input UI where the placeholder renders. I'm doing a lot of reverse engineering here.
<!-- The data entry control -->
<asp:placeholder id="placeholder" runat="server" />
I was able to do what I needed on prerender of the control. Still a hack, but it works.
Are you planning on doing any enhancements to the ASP.NET version of Contour? Or just planning on enhancing the MVC version? It wouldn't be that difficult to create templated rendering control if you did. Just a thought.
Tim, would you be willing to discuss extending/maintaining the usercontrol version for those of us who still use Webforms and get better integration when implementing controls this way?
Absotutely. If you're willing to share the source for the user control method of implementing the macros that would definitely help. How can I get in touch with you? The forums don't provide contact information.
Access PageCssClass Literal Class Name
I'm using the User Control method of embedding contour forms into our site (ASP.NET not MVC), and am trying to access the PageCssClass values rather than how they are written out to the tag using the literal now. Is there a way to access the classnames or do I have to write a parser to derive them from the Literal's text field?
Thanks.
Comment author was deleted
Yeah no way to retrieve them, i could give you the code that is used to generate if that helps?
That would be great, thanks Tim.
Comment author was deleted
pageCssClass.Text = "class=\"" + Data.XmlHelper.XmlName(formService.Form.Name) + " " + Data.XmlHelper.XmlName(formService.CurrentPage.Caption) + "\"";
Comment author was deleted
public static string XmlName(string caption) {
Looks like you're doing your own parsing as well. Either way I'd end up having to parse something. Might just be easier to parse out the markup: class="([^"]+)".
Just in case, formService.CurrentPage is found how? That would be a local member variable to your API right? What does it represent?
Thanks for the help.
Tim, do you you have any documentation on extending Contour ASCX UI as you have provided for the Razor implementation? I've successfully extended the RenderForm.ascx control but am not finding a lot of documentation on modifying the input UI where the placeholder renders. I'm doing a lot of reverse engineering here.
Thanks.
Comment author was deleted
Nope not recommended to extend that one since you might break some stuff, not as easy as with the razor one
I was able to do what I needed on prerender of the control. Still a hack, but it works.
Are you planning on doing any enhancements to the ASP.NET version of Contour? Or just planning on enhancing the MVC version? It wouldn't be that difficult to create templated rendering control if you did. Just a thought.
Comment author was deleted
Nope no changes will happen to the usercontrol version, razor one is the prefered option
Tim, would you be willing to discuss extending/maintaining the usercontrol version for those of us who still use Webforms and get better integration when implementing controls this way?
Comment author was deleted
Not sure we'll be putting lot's of effort in that one but open to discuss
We could share the code for the control if that helps you out
Absotutely. If you're willing to share the source for the user control method of implementing the macros that would definitely help. How can I get in touch with you? The forums don't provide contact information.
Comment author was deleted
tg at umbraco dot com
Comment author was deleted
But will make it public later this week, just wating on the final ok
Comment author was deleted
Ok code is here
https://gist.github.com/anonymous/8953426
Comment author was deleted
You'll just need to replace the existing form usercontrol with your custom one then
Awesome! Thank you very much. We'd be willing to help maintain this (with updates) if you make it a contributable project on Github.
Comment author was deleted
Yeah will do that, thanks that's great :)
is working on a reply...