Page 1 of 1

"&" saving to database like "&"

Posted: Sat Oct 01, 2022 5:43 am
by melcv

I don't know if it happens to someone else:

When I save a data with "&" but when i check in the base it is stored as "&" not as "&".

Can someone explain this to me? Or why this happens?


Re: & saving to database like &amp

Posted: Sat Oct 01, 2022 8:01 am
by mobhar

It's a XSS protection. If you want to save & character without changing to &, then you may simply put this following code in Page_Load server event of your Add/Edit Page:

$this->YourFieldName->Raw = true; // adjust YourFieldName to your actual field name

That means, you are sure that field will contain the raw (original) data when will be saved into database.