Hi Rahul,
Here's a sample demonstrating the .Namespace property. Description below.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Button1_Click(object sender, DirectEventArgs e)
{
var msg = "Name : {0}<br />City : {1}<br />Country : {2}";
msg = string.Format(msg,
this.txtFirstName.Text + " " + this.txtLastName.Text,
this.txtCity.Text,
this.txtCountry.Text);
X.Msg.Notify("Information", msg).Show();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET Example</title>
<script type="text/javascript">
var doSomething = function () {
var msg = "Name : {0}<br />City : {1}<br />Country : {2}",
x = CompanyX;
msg = String.format(msg,
x.txtFirstName.getValue() + " " + x.txtLastName.getValue(),
x.address.txtCity.getValue(),
x.address.country.getValue());
Ext.Msg.notify("Information", msg);
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" Namespace="CompanyX" IDMode="Explicit" />
<ext:Window
ID="Window1"
runat="server"
Title="Example"
Height="215"
Width="350"
Padding="5"
Layout="form">
<Items>
<ext:TextField
ID="txtFirstName"
runat="server"
FieldLabel="First Name"
Text="Wayne"
/>
<ext:TextField
ID="txtLastName"
runat="server"
FieldLabel="Last Name"
Text="Gretzky"
/>
<ext:FieldSet runat="server" Title="Address" Namespace=".address">
<Items>
<ext:TextField
ID="txtCity"
runat="server"
FieldLabel="City"
Text="L.A."
/>
<ext:TextField
ID="txtCountry"
ItemID="country"
runat="server"
FieldLabel="Country"
Text="USA"
/>
</Items>
</ext:FieldSet>
</Items>
<Buttons>
<ext:Button runat="server" Text="Submit (Server)" OnDirectClick="Button1_Click" />
<ext:Button runat="server" Text="Submit (Client)" OnClientClick="doSomething();" />
</Buttons>
</ext:Window>
</form>
</body>
</html>
Key points:
1.) The .Namespace property is available on all Ext.NET Components and can be set on the <ext:ResourceManager>, in the Web.config and as an Application wide global variable.
By default, if the .Namespace is set, the Ext.NET Components will add themselves by their .ClientID to the namespace object on the client
Example
// without .Namespace
alert(txtFirstName.getValue());
// with .Namespace
alert(CompanyX.txtFirstName.getValue());
2.) More than one .Namespace is permissible on the Page and group Components as required.
3.) Namespaces are inherited by child components from the parent, although a child component create a new .Namespace which it (and all its children) will be added to.
4.) Child components can create sub-namespaces. See the <ext:Fieldset> configuration above. All children of Fieldset will be added to the sub "address" object.
Example
alert(CompanyX.address.txtCity.getValue());
5.) Setting the .ItemID will override the client-side .ClientID property
and does not need to be unique on the page. See configuration for "txtCounty" above.
Example
alert(CompanyX.address.country.getValue());
Hope this helps explain the property. Let us know if there's other functionality you would like that might be missing.