Solved

How do I pass querystring from the detailsview update?

Posted on 2010-11-08
2
414 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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

11 Experts available now in Live!

Get 1:1 Help Now