Chalk Plugin to Respond to a Form Post
The previous tip demonstrated how to create a form in a Graffiti post. The next step is to respond to that event in some way or another. This post will demonstrate one way to handle an event from a form post using a Graffiti plugin.
public class PostLinkButton : GraffitiEvent
{
public override string Name
{
get
{
return "Form Post";
}
}
public override string Description
{
get
{
return "This plug-in reacts to a Form Post Event.";
}
}
public override void Init(GraffitiApplication ga)
{
ga.RenderPostBody += new RenderPostBodyEventHandler(ga_RenderPostBody);
}
void ga_RenderPostBody(StringBuilder sb, PostEventArgs e)
{
if (HttpContext.Current.Request.Form["__HiddenVariable"] != null)
sb.Append("Form Value (First Name): " + HttpContext.Current.Request.Form["FirstName"]);
}
}

Hi,
I added an Html submit button in the previous example
Like
public string Write()
{
var sb = new StringBuilder();
sb.AppendFormat("<form method='post' name='form' action='{0}'>", HttpContext.Current.Request.Url);
sb.AppendLine("<input type='text' name='textbox1' />");
sb.AppendLine("<input id='Button1' type='submit' value='Submit' />");
sb.AppendLine("</form>");
return sb.ToString();
}
Now I need to display the text in the textbox upon submit. I am confused on how to link the form submit with the previous code snippet.