Hi, in my project I have a “Configs” table which contains one configuration record with some parameters.
For example I have many tables with “Image” field that I want to resize to width and height parameters taken from “Images_UploadResizeWidth” and “Images_UploadResizeHeight” take from “Configs” table.
In practice, I don’t want to set these fields at the anm project level, but I want to setup them at runtime so the user can set the values as desidered.
In the Page_Load event I want to setup the values, but id doesn’t function as expected. Any idea?public void Page_Load() {
//Log(“Page Load”);
Dictionary<string, object> CfgObj=ExecuteRow(“SELECT * FROM configs WHERE Code=‘default’;”);
Image.ImageCropper = true;
Image.ImageWidth = (int) CfgObj[“Images_UploadResizeWidth”]; // Resize width
Image.ImageHeight = (int) CfgObj[“Images_UploadResizeHeight”]; // Resize height
Thumbnail.ImageCropper = true;
Thumbnail.ImageWidth = (int) CfgObj[“Images_UploadResizeWidth”]; // Resize width
Thumbnail.ImageHeight = (int) CfgObj[“Images_UploadResizeHeight”]; // Resize height
}
Make sure that you have add the codes to all required pages (e.g. list/add/edit).