Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Submitting a form in a connector
MikeatBDB
Hi
I am trying to use an HTML form inside of a connector. This works fine in version 4.2 but I cannot get the variables back in version 8. The Request function is not available from within the connector class so I can't pick up the values after the form has been submitted. We use this for an external client and we need to keep this facility for the extranet we use.
Thanks
Mike
Bircham Dyson Bell
Find more posts tagged with
Comments
Migrateduser
In order to get Request Object in connector Class you need address as
HttpContext.Current.Request object (You may need to including System.Web as a reference with "using" statement)
What does the connector do after you submit the form ? Does it refresh the same page after some operation or does it redirect to some other page?
If it redirects to some other page I would recommend to create another .aspx page or httphandler and put that in your form -"action" attrbute
MikeatBDB
All it does is to write to a database and update the page being used with some extra info from a second database. I'll try your suggestion.
Thanks
Mike
MikeatBDB
It all works. Here's some sample code for a simple submit connector if you need it for yourselves.
string strVal = "";
HttpRequest req;
req = HttpContext.Current.Request;
strVal = req.Form.Get("val");
string code = "<form name=\"frm\" action=\"\" method=\"post\">";
code += "<p>:" + strVal + ":</p>";
code += "<br><input type=\"text\" value=\"\" name=\"val\">";
code += "<br><input type=\"button\" value=\"Submit\" onclick=\"document.frm.action=location.href;document.frm.submit();\">";
code += "</form>";
return code;
MikeatBDB
Futher to this:
In Worksite 4.2 to get the submit to return to the exact tab the connector is on use the following
document.frm.action = "
http://net.bdb-law.co.uk/worksite/scripts/home.asp?page="
+ page.id + "&tabid=" + innerTabsObj.getSelection();
document.frm.submit();
in the onClick (or a javascript function called by onClick).
I still have to try this in Worksite 8. I still have to work on Worksite 4.2 until we migrate in the new year.
Regards
Mike
Bircham Dyson Bell
Migrateduser
This should work in Worksite 8.0 as well... I dont think anythign has change in that front... except that TABS in 8.0 are server side objects. What it means is you can see the TABS in other applications like FileSite and Desksite. Until 4.X Tabs were just an XML representation stored on a workspace..
MikeatBDB
I have tried it on Worksite 8 it works perfectly
Bircham Dyson Bell