G
Guest
I have one web user Control "AddressType.ascx". This is used mainly to add
new records.The control have two buttons named cmdSave and cmdCancel and a
TextBox named txtAddressType. The code for cmdSave is as follows
int iNewID;
using(AddressType oBFAddressType = new AddressType())
{
try {
iNewID=oBFAddressType.AddAddressType(txtAddressType.Text);
}
catch(Exception ex)
{
object oCntxHandler = Context.Handler;
System.Type typCntx = Context.Handler.GetType();
PropertyInfo pinfoErrMsg = typCntx.GetProperty("ErrMsg");
pinfoErrMsg.SetValue(oCntxHandler, ex.Message, null);
}
}
The code will add new address type and returns error by stored procedure if
address type already exists. The parent page has ErrorMsg property which
displays Error Message in Label Control.This property value is set from web
user control using reflection as shwon above.
I have added this control runtime in PlaceHolder as
phEditData.Controls.Add(LoadControl("AddressType.ascx"));
When I click on cmdSave of web user control and error get raised from
stored procedure the title of IE window running parent page disappears. The
parent page is open by using Window.ShowModelDialog method using javascript.
I want to display same title in title bar of window and error description in
lblErrorMessage control.
Please let me know how to over come this problem and why it happend.
Thanks in advance.
new records.The control have two buttons named cmdSave and cmdCancel and a
TextBox named txtAddressType. The code for cmdSave is as follows
int iNewID;
using(AddressType oBFAddressType = new AddressType())
{
try {
iNewID=oBFAddressType.AddAddressType(txtAddressType.Text);
}
catch(Exception ex)
{
object oCntxHandler = Context.Handler;
System.Type typCntx = Context.Handler.GetType();
PropertyInfo pinfoErrMsg = typCntx.GetProperty("ErrMsg");
pinfoErrMsg.SetValue(oCntxHandler, ex.Message, null);
}
}
The code will add new address type and returns error by stored procedure if
address type already exists. The parent page has ErrorMsg property which
displays Error Message in Label Control.This property value is set from web
user control using reflection as shwon above.
I have added this control runtime in PlaceHolder as
phEditData.Controls.Add(LoadControl("AddressType.ascx"));
When I click on cmdSave of web user control and error get raised from
stored procedure the title of IE window running parent page disappears. The
parent page is open by using Window.ShowModelDialog method using javascript.
I want to display same title in title bar of window and error description in
lblErrorMessage control.
Please let me know how to over come this problem and why it happend.
Thanks in advance.