Link to home
Start Free TrialLog in
Avatar of steva
steva

asked on

Modifying a QueryString for use in an Update parameter

I've specified some QueryString parameters, as shown below, to use as Update parameters:

<UpdateParameters>
             <asp:QueryStringParameter Name="FirstName" QueryStringField="FirstName" Type="String" />
             <asp:QueryStringParameter Name="LastName" QueryStringField="LastName" Type="String" />
 </UpdateParameters>

But how would I make a modification to QueryString parameter before using it in the database.  Suppose I wanted to make all the characters upper case, or perhaps use only the first 4 characters?

Thanks for any ideas.
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steva
steva

ASKER

I'm using SqlDataSource.  I appreciate your example of catching the update event and making the modification there.  I was hoping, though,  to find a solution that would work directly within the parameter section, without any VB code.  But I guess that just doesn't exist. If I have to move outside the parameter section and do something on the VB page I prefer to set up a literal web control on the aspx page that the parameter section reads with asp:ControlParameter,  and then prepare the literal.Text field of the control on the VB page:

             <asp:ControlParameter     Name="ServicePack" ControlID="ServicePack" PropertyName="Text" Type="String" />

On VB:

        SP = Request.QueryString("SP")    ' "Service Pack 3"
        SP = SP.Substring(13, SP.Length - 13)
        ServicePack.Text = SP          ' "3"

I gave you the points for the discussion.
Avatar of steva

ASKER

Used another solution, but the discussion convinced me there was no simpler way.