Hi,
I cannot find any online documentation for Dynamicweb.Base class - where can I find that?
Med venlig hilsen/Best regards,
Sten Hougaard
Webudvikler
E: sho@1stweb.dk
M: 29850818
A: København/Aarhus . W: www.1stweb.dk
@: netsi1964
Hi,
I cannot find any online documentation for Dynamicweb.Base class - where can I find that?
Med venlig hilsen/Best regards,
Sten Hougaard
Webudvikler
E: sho@1stweb.dk
M: 29850818
A: København/Aarhus . W: www.1stweb.dk
@: netsi1964
You cannot.
You should not use it. Anything in particular you are looking for? It is probably somewhere else.
BR Nicolai
I was looking for say:
Base.Request()
and
Base.ChkString()
/Sten
Hi Sten,
The Base class is basically a kind of "Swiss knife" to wrap commonly used functions for faster use. But the class is intended for "internal Dynamicweb" use - which is why it is not documented.
Base.Request() will return the value of the given form field / query string. If not found, an empty string is returned.
Base.ChkString() will return the string value of the given parameter. If unable to parse, an empty string is passed.
Use the class at own risk.
Regards /Snedker
DW should really mark methods as internal, obsolete and/or hide them from intellisense if we're not supposed to use them.
Anyway, you can use the Input class instead:
Input.Request(...)
Input.FormatString(...)
Will Input.Request
also do SQLInjection check?
/Sten
Yes, Input.Request will also do SQLInjection check by default, but you can avoid that by using the overload Input.Request("param", false) in case you need to get the original value (no "dangerous" words or characters stripped).
Thanks Morten,
Do you by chance have the full path to the "Input.Request" method? Is it in Dynamicweb.Input?
/Sten
Yes, like this:
string value = Dynamicweb.Input.Request("param")
It is a lot easier to use the API if you setup your project so that you have intellisense. That will also provide you with some documentation of most methods in DW ;-)
https://github.com/dynamicweb/razor/wiki/Editing-Razor-templates
You should never send user input directly to the database. Always use a Command with Parameters. See these posts for examples:
And I would use HttpContext.Request to get query parameters (see first example above).
Best regards,
Mikkel
Sten
Dynamicweb.Input documentation here:
http://developer.dynamicweb-cms.com/api8/#Dynamicweb~Dynamicweb.Input_members.html
Dynamicweb scans all incoming requests no matter what and check for SQL injection checks.
You must be logged in to post in the forum