Solved

getting a parameter from the url

Posted on 2013-01-23
4
313 Views
Last Modified: 2013-01-23
I am trying to get the value of the parameter in the url so I can pass it to my sql statement located in my aspx page- does anyone know how to do that
<asp:SqlDataSource runat="server" ID="UserDD" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                               SelectCommand=" Select useruid, FirstNm + '' + LastNm as username from PLMUser where useractive = 1 AND UserUID <> @mgruseruid And UserUID not in(select staffuseruid FROM PLMManagerStaff WHERE mgruseruid = @mgruseruid">
                <SelectParameters>
                    <asp:Parameter Name="mgruseruid" Type="Int32" DefaultValue=<%#Convert.ToInt32(Request["MID"])%>/>
                </SelectParameters>
    </asp:SqlDataSource>

Open in new window

0
Comment
Question by:r3nder
  • 3
4 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 38811770
Request.QueryString["MID"]
0
 
LVL 35

Expert Comment

by:YZlat
ID: 38811778
<SelectParameters>
      <asp:QueryStringParameter Name="mgruseruid" QueryStringField="MID" />
 </SelectParameters>
0
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 38811789
<asp:SqlDataSource runat="server" ID="UserDD" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                               SelectCommand=" Select useruid, FirstNm + '' + LastNm as username from PLMUser where useractive = 1 AND UserUID <> @mgruseruid And UserUID not in(select staffuseruid FROM PLMManagerStaff WHERE mgruseruid = @mgruseruid">
                <SelectParameters>
                    <asp:QueryStringParameter Name="mgruseruid" QueryStringField="MID" />

                </SelectParameters>
    </asp:SqlDataSource> 

Open in new window

0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 38811864
Thank you YZlat
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question