M
magister
Hello, I have a asp.net page with a form with 15 textboxes and a
couple of dropdownlists....I want to know if their is a way
(...serverside please...) of checking if any change has been made to
any of these controls before I send and update to the database....I
would rather not have a OnTextChanged & OnSelectedItemChanged with
postback set to false for every control on the page...
I have been trying to implement the IPostBackEventHandler in the page
System.Web.UI.Page, IPostBackEventHandler
and then override methods in it, but I think this is mostly for
customcontrols
public override void RaisePostBackEvent( IPostBackEventHandler
sourceControl, string eventArgument)
{
Response.Write( "<b>This is the RaisePostBackEvent event.</b><br>" );
}
public virtual void RaisePostDataChangedEvent()
{
Response.Write( "<b>This is the RaisePostDataChangedEvent");
}
public virtual bool LoadPostData(string postDataKey,
NameValueCollection postCollection)
{
string presentValue = _text;
string postedValue = postCollection[postDataKey];
if (!presentValue.Equals(postedValue))
{
_text = postedValue;
return true;
}
return false;
}
couple of dropdownlists....I want to know if their is a way
(...serverside please...) of checking if any change has been made to
any of these controls before I send and update to the database....I
would rather not have a OnTextChanged & OnSelectedItemChanged with
postback set to false for every control on the page...
I have been trying to implement the IPostBackEventHandler in the page
System.Web.UI.Page, IPostBackEventHandler
and then override methods in it, but I think this is mostly for
customcontrols
public override void RaisePostBackEvent( IPostBackEventHandler
sourceControl, string eventArgument)
{
Response.Write( "<b>This is the RaisePostBackEvent event.</b><br>" );
}
public virtual void RaisePostDataChangedEvent()
{
Response.Write( "<b>This is the RaisePostDataChangedEvent");
}
public virtual bool LoadPostData(string postDataKey,
NameValueCollection postCollection)
{
string presentValue = _text;
string postedValue = postCollection[postDataKey];
if (!presentValue.Equals(postedValue))
{
_text = postedValue;
return true;
}
return false;
}