J
jeremy.brewster
Hello
I have an ObjectDataSource object on a webform, and the
ObjectDataSource object includes a series of asp:ControlParameter
object as SelectParameters. Some of these ControlParameter object
refer to drop-down lists and some refer to asp:TextBoxes.
My problem is that to be able to use an existing business layer object,
I want to be able to pass zero-length strings for each asp:TextBox that
is left empty. These values keep being passed as nulls. Is there any
way to intercept each TextBox value and set the value to String.Empty
if the TextBox is empty? I've tried intercepting the values in the
Select event but I cannot override the value from there.
<aspbjectdatasource id="ObjectDataSource1" runat="server"
typename="Business.UserManager" selectmethod="FindUserSearch"
onselecting="ObjectDataSource1_Selecting"
oninit="ObjectDataSource1_Init">
<selectparameters>
<asp:controlparameter name="membershipNumber" type="Int32"
controlid="MembershipNumberTextBox" propertyname="Text" />
<asp:controlparameter name="userSecurityRoleId" type="String"
controlid="SecurityRoleDropDownListControl1"
propertyname="SelectedValue" />
<asp:controlparameter name="firstName" type="String"
controlid="FirstNameTextBox" propertyname="Text" />
<asp:controlparameter name="surname" type="String"
controlid="SurnameTextBox" propertyname="Text" />
<asp:controlparameter name="email" type="String"
controlid="EmailTextBox" propertyname="Text" />
<asp:controlparameter name="postcode" type="String"
controlid="EmailTextBox" propertyname="Text" />
<asp:controlparameter name="isActive" type="Boolean"
controlid="StatusDropDownList" propertyname="SelectedValue" />
</selectparameters>
</aspbjectdatasource>
I have an ObjectDataSource object on a webform, and the
ObjectDataSource object includes a series of asp:ControlParameter
object as SelectParameters. Some of these ControlParameter object
refer to drop-down lists and some refer to asp:TextBoxes.
My problem is that to be able to use an existing business layer object,
I want to be able to pass zero-length strings for each asp:TextBox that
is left empty. These values keep being passed as nulls. Is there any
way to intercept each TextBox value and set the value to String.Empty
if the TextBox is empty? I've tried intercepting the values in the
Select event but I cannot override the value from there.
<aspbjectdatasource id="ObjectDataSource1" runat="server"
typename="Business.UserManager" selectmethod="FindUserSearch"
onselecting="ObjectDataSource1_Selecting"
oninit="ObjectDataSource1_Init">
<selectparameters>
<asp:controlparameter name="membershipNumber" type="Int32"
controlid="MembershipNumberTextBox" propertyname="Text" />
<asp:controlparameter name="userSecurityRoleId" type="String"
controlid="SecurityRoleDropDownListControl1"
propertyname="SelectedValue" />
<asp:controlparameter name="firstName" type="String"
controlid="FirstNameTextBox" propertyname="Text" />
<asp:controlparameter name="surname" type="String"
controlid="SurnameTextBox" propertyname="Text" />
<asp:controlparameter name="email" type="String"
controlid="EmailTextBox" propertyname="Text" />
<asp:controlparameter name="postcode" type="String"
controlid="EmailTextBox" propertyname="Text" />
<asp:controlparameter name="isActive" type="Boolean"
controlid="StatusDropDownList" propertyname="SelectedValue" />
</selectparameters>
</aspbjectdatasource>