• Skip to main content
  • Skip to primary sidebar
  • Home
  • About
  • Recommended Readings
    • 2022 Book Reading
    • 2023 Recommended Readings
    • Book Reading 2024
    • Book Reading 2025
    • Book Reading 2026
  • Supply Chain Management Guide
  • PKM
  • Microsoft Excel
  • Microsoft Copilot in Office 365
  • Public Wiki Page

Ali Raza Zaidi

A practitioner’s musings on Dynamics 365 Finance and Operations

Uncategorized

How to move on next page in document while using TX Text Control

February 27, 2008 by alirazazaidi

Naviagation between pages is very  easy while using Tx Text control for documents like doc, txt,rtf and html in you dot net application. We have to use InputPosition of Tx Text Control its syntex is following

public InputPosition(int page, int line, int column);

here is sample code

Dim PageNo As IntegerPageNo = InputBox(“Page no.”, “Go to page”, “1”)If PageNo > 0 And PageNo <= TxtEditor.Pages Then

TxtEditor.ViewMode = TXTextControl.ViewMode.PageViewDim InputPosition As New TXTextControl.InputPosition(PageNo, 1, 0)TxtEditor.InputPosition = InputPosition //TxtEditor is name of txt textControlTxtEditor.ScrollLocation =

New System.Drawing.Point(0, TxtEditor.InputPosition.Location.Y)ElseMsgBox(“Page number outside valid range.”, MsgBoxStyle.Exclamation)End If

reference : http://www.textcontrol.com/downloads/library/menu/position/

How to add dynamic meta tags in asp.net

February 9, 2008 by alirazazaidi

Hi all you can add meta tags like that in page

HtmlMeta _MyName = new HtmlMeta();
_MyName.Name =” Ali Raza”;
_MyName.Content =” just in and test “;
Page.Header.Controls.Add(_MyName);

How to get uploaded image dimensions in asp.net

February 5, 2008 by alirazazaidi

I used following code to get uploaded image dimensions .
Where flLogoUplaoded is name of asp .net file uploaded control at my application
string UploadedImageType = flLogoUpload.PostedFile.ContentType.ToString().ToLower();
string UploadedImageFileName = flLogoUpload.PostedFile.FileName;

//Create an image object from the uploaded file
System.Drawing.Image UploadedImage = System.Drawing.Image.FromStream(flLogoUpload.PostedFile.InputStream);

//Determine width and height of uploaded image
float UploadedImageWidth = UploadedImage.PhysicalDimension.Width;
float UploadedImageHeight = UploadedImage.PhysicalDimension.Height;

Response.Write( UploadedImageWidth + “<br />”);
Response.Write(UploadedImageHeight + “<br />”);

Regular expression for html Table Parsing

February 1, 2008 by alirazazaidi

here are some Regular expressions for html parsing . you can use it in your application while parsing html table to fetch data from it

  1.  Table Expression  = “<table[^>]*>(.*?)</table>”  
  2.   Header Expression  = “<th[^>]*>(.*?)</th>”  
  3.   Row Expression  = “<tr[^>]*>(.*?)</tr>”  
  4.   Column Expression  = “<td[^>]*>(.*?)</td>”  

 

Saving and Restoring Form Location

January 15, 2008 by alirazazaidi

A common requirement for a form is to remember its last location. Usually, this information
is stored in the registry. The code that follows shows a helper class that automatically stores
information about a form’s size and position using a key based on the name of a form.
public class FormPositionHelper
{
public static string RegPath = @”SoftwareApp”;
public static void SaveSize(System.Windows.Forms.Form frm)
{
// Create or retrieve a reference to a key where the settings will be stored.
RegistryKey key;
key = Registry.LocalMachine.CreateSubKey(RegPath + frm.Name);
key.SetValue(“Height”, frm.Height);
key.SetValue(“Width”, frm.Width);
key.SetValue(“Left”, frm.Left);
key.SetValue(“Top”, frm.Top);
}

public static void SetSize(System.Windows.Forms.Form frm)
{
RegistryKey key;
key = Registry.LocalMachine.OpenSubKey(RegPath + frm.Name);
if (key != null)
{
frm.Height = (int)key.GetValue(“Height”);
frm.Width = (int)key.GetValue(“Width”);
frm.Left = (int)key.GetValue(“Left”;
frm.Top = (int)key.GetValue(“Top”);
}
}
}
To use this class in a form, you call the SaveSize() method when the form is closing:

private void MyForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
FormPositionHelper.SaveSize(this);
}
and call the SetSize() method when the form is first opened:

private void MyForm_Load(object sender, System.EventArgs e)
{
FormPositionHelper.SetSize(this);
}

How to fix the size of windows form at different monitor resolution

January 15, 2008 by alirazazaidi

Some time developer/coder have to choose appropriate location of windows form on the screen, But limitation comes with the size and resolution of monitor. The solution is used Screen Class which gives right gives you working area of screen of monitor. Then Form load Event will look like this

private void dynamicSizeForm_Load(System.Object sender, System.EventArgse)
{
Screen scr = Screen.PrimaryScreen;
this.Left = (scr.WorkingArea.Width – this.Width) / 2;
this.Top = (scr.WorkingArea.Height – this.Height) / 2;
}
You can use above code to fix the location and size of windows form when it loads

Screen.PrimaryScreen 

Returns a Rectangle structure that represents the bounds
of the display area for the current screen, minus the space
taken for the taskbar and any other docked windows.

Session vs ViewState

January 15, 2008 by alirazazaidi

Session State is useful for storing values that must be persisted across
multiple pages by the same user. ViewState is useful for storing
serializable data that must be persisisted across PostBacks by a single
page. If you use Session State, the value you insert will remain in memory
until (1) The Session times out, or (2) Your code removes it. If you use
ViewState, the value you insert will remain in ViewState until the user
requests a different page.

ViewState stores data betwen PostBacks by putting it into a hidden form
field on the client HTML doc. when the doc is Posted Back, the values are
read from the hidden form field and stored in memory until the page has
finished processing. If ViewState is particularly large (and I’m talking KBs
here, not 6 bytes), it can negatively affect the speed at which the HTML doc
is downloaded by the browser.

Use the right tool for your job. I think after my explanation, it should be
obvious that you would want to use ViewState in your specific case.

URL Encoding in asp.net

December 27, 2007 by alirazazaidi

One of way while transferring data from one page to other page is Querystring. But one problem is with Querystring is that many characters are not allowed in url.  So we must have to send querystings while take limits in mind because alphanumeric and special characters including $-_.+!*’(),) are allowed. Usually browser does not tolerate special characters in Url, so much data is lost . In asp.net we can use the feature urlEncoding. With Url encoding special characters are replaced by escaped characters sequences starting with the percent sign (%) ,followed by a two-digit hexadecimal .The only exception is space character where character sequence %20 or + sign is used.  For this purpose asp.net provide us HttpServerUtility  class to encode data.

For example

String  CustomerName = “Ali Raza”;

Response.Redirect(“Blogpage.aspx?authorName=” + Server.UrlEncode(CustomerName));

 

Same time we can Querystring s initial values from Server.UrlDecode() method.

Best Wishes for Christmas

December 19, 2007 by alirazazaidi

Best Wishes to all my friends who are blessed by jesus’s Love

ws_christmas_tree_1024x7681-copy.jpg

Ali Raza   wishes you Merry Christmas and Happy New Year!

May the year 2008 bring success, good times, happiness and more opportunities for all of us.

How to make better URI

December 3, 2007 by alirazazaidi

  • It should be as short as possible. Don’t sacrifice consistency or obviousness, but be brief.

  • Organize and name things logically. ASP.NET isn’t always helpful in keeping a clean structure, so I highly recommend that you use a URL rewriting module. URIs should be ‘hackable’ – see http://www.useit.com/alertbox/990321.html.

  • URIs should be deterministic.

    • No two URIs should ever display the same page

    • The same URI should always display the same content.

  • The query string should only contain data that AFFECTS THE QUERY. If it doesn’t describe the content, it doesn’t belong.

  • The URI path should not rely on cryptic or numerical identifiers. If it does, it should also provide a human-readable title. It’s really nice to be able to look at a URL and guess what it contains – especially when you have a long list of them. As a bonus, search engines absolutely love URIs that match keywords. Tip: Don’t try to spam URLs with keywords. Density algorithms are applied here, also. As with page titles, pick exactly 1 keyword and stick with it.

Further reading (written by Tim Berners-Lee): http://www.w3.org/Provider/Style/URI.

Bad examples:

  • /Default.aspx?tabid=3

  • /Products/ShowProduct.aspx?prodid=4982

  • /showblog.aspx?articleid=98

Better examples:

  • /Default.aspx?tabid=3&title=ContactUs

  • /Products/ShowProduct.aspx?id=4982&product=Nokia_Wall_Adpater_12V

  • /showblog.aspx?articleid=98&title= Why_you_should_never_concatenate_SQL_commands

Best:

  • /contact/

  • /products/4982_Nokia_Wall_Adapter_12v

  • /blog/98_Why_you_should_never_concatenate_SQL_commands

 Reference

http://www.beansoftware.com/ASP.NET-Tutorials/URI-Design.aspx

« Previous Page
Next Page »

Primary Sidebar

About

I am Dynamics AX/365 Finance and Operations consultant with years of implementation experience. I has helped several businesses implement and succeed with Dynamics AX/365 Finance and Operations. The goal of this website is to share insights, tips, and tricks to help end users and IT professionals.

Legal

Content published on this website are opinions, insights, tips, and tricks we have gained from years of Dynamics consulting and may not represent the opinions or views of any current or past employer. Any changes to an ERP system should be thoroughly tested before implementation.

Categories

  • Accounts Payable (2)
  • Advance Warehouse (2)
  • AI (3)
  • Asset Management (3)
  • Azure Functions (1)
  • Books (6)
  • Certification Guide (3)
  • ChatGPT (3)
  • Claude (1)
  • Customization Tips for D365 for Finance and Operations (64)
  • D365OF (60)
  • Data Management (1)
  • database restore (1)
  • Dynamics 365 (59)
  • Dynamics 365 for finance and operations (139)
  • Dynamics 365 for Operations (175)
  • Dynamics AX (AX 7) (134)
  • Dynamics AX 2012 (274)
  • Dynamics Ax 2012 Forms (13)
  • Dynamics Ax 2012 functional side (16)
  • Dynamics Ax 2012 Reporting SSRS Reports. (31)
  • Dynamics Ax 2012 Technical Side (52)
  • Dynamics Ax 7 (65)
  • Exam MB-330: Microsoft Dynamics 365 Supply Chain Management (7)
  • Excel Addin (1)
  • Favorites (12)
  • Financial Modules (6)
  • Functional (8)
  • General Journal (1)
  • Implementations (1)
  • Ledger (1)
  • Lifecycle Services (1)
  • Logseq (4)
  • Management Reporter (1)
  • Microsoft Excel (4)
  • MS Dynamics Ax 7 (64)
  • MVP summit (1)
  • MVP summit 2016 (1)
  • New Dynamics Ax (19)
  • Non Defined (9)
  • Note taking Apps (2)
  • Obsidian (4)
  • Personal Knowledge Management (3)
  • PKM (16)
  • Power Platform (6)
  • Procurement (5)
  • procurement and sourcing (6)
  • Product Information Management (4)
  • Product Management (6)
  • Production Control D365 for Finance and Operations (10)
  • Sale Order Process (10)
  • Sale Order Processing (10)
  • Sales and Distribution (5)
  • Soft Skill (1)
  • Supply Chain Management D365 F&O (5)
  • Tips and tricks (278)
  • Uncategorized (165)
  • Upgrade (1)
  • Web Cast (7)
  • White papers (4)
  • X++ (10)

Wiki

  • SCM

Copyright © 2026 · Magazine Pro On Genesis Framework · WordPress · Log in