Solved

How do I pass querystring from the detailsview update?

Posted on 2010-11-08
2
422 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

930 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now