Solved

How do I pass querystring from the detailsview update?

Posted on 2010-11-08
2
442 Views
Last Modified: 2012-05-10
Dear Experts,

I have this DetailsView with ShowEditButton set to true. When user click Update, I need to pass a querystring from inside the EditItemTemplate, the value of the querystring should be from one of the dropdown selectedvalue. How can I do that?
Thanks,
Dan
0
Comment
Question by:luisr69
[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
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 34095402
You want to pass querystring to what?
You can definitely grab the value of dropdown something like this in the DV ItemUpdating event that is fired when you click the Update button:

protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        DropDownList ddl = (DropDownList )DetailsView1.FindControl("DropDownList 1");
        string value = ddl.SelectedValue;

       //OR try getting new value using correct index / name of your ddl field
        string newvalue = e.NewValues[1].ToString();

       //you can use this value to pass it to querystring
    }
0
 

Author Comment

by:luisr69
ID: 34096148
I use this:

protected void DetailsViewAuditEdit_ItemUpdated(Object sender, System.Web.UI.WebControls.DetailsViewUpdatedEventArgs e)
    {
        DropDownList ddl = (DropDownList)DetailsViewAuditEdit.FindControl("lstBranch");
        string value = ddl.SelectedValue;
        //pass the query string
     }

And it works. That's what I was looking for. Thanks.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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