Solved

getting a parameter from the url

Posted on 2013-01-23
4
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…

726 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