.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

DetailsView CrossPage postback MasterPage

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net

I'm using a master page.

I've a DetailsView which I would like to pass an ID across to another page but cannot figure out how to do it!

My ContenPlaceHolder is called MainContent, DetailsView is called DetailsView1

This is what I have:

<%@ PreviousPageType VirtualPath="~/complaints/WorkFlow02.aspx" %>

        if (PreviousPage != null && PreviousPage.IsCrossPagePostBack)
            DetailsView ID;
            ID = (DetailsView)Page.PreviousPage.FindControl("ID");
            //GridView iValue = PreviousPage.FindControl("complaintsGridView") as GridView;
            lblGetID.Text = ID.ToString();

Can anyone help?

View Complete Post

More Related Resource Links

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

Master-Detail with the GridView, DetailsView and jQuery's ThickBox

One more article about grids from Matt Berseth. This time he shows how to create master-detail with the gridview, detailsview and jQuery's ThickBox. He writes:
So I thought I would check some of this out and along the way rebuild my Master-Detail with the GridView, DetailView and ModalPopup Controls and replace the ModalPopup with jQuery's ThickBox. I found it pretty interesting - read on to see how it went

jQuery live() and ASP.NET Ajax asynchronous postback

The issue is that normally $(document).ready() is called when the DOM is ready to be manipulated. But this doens't happen after an ASP.NET Ajax asynch postback occurs.

This means that the initial jQuery bindings won't be automatically available after the asynchronous postback is over. I underline "automatically" here because my last post describes more possibilities, how this issue can be worked around.

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

page postback problem with crystal report


Hi , i am creating crystal report with asp.net it is working showing data but  data is of two page its is take round trip action but report is not show 
until again i click on show button in this it is not propersly showing that data is how.

<br />
    <asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="Show Report" />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" DisplayGroupTree="False" EnableDatabaseLogonPrompt="False" /> CrystalReportViewer1.ReportSource = null; SqlCommand cmd = new SqlCommand(strcmd, c.con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); ReportDocument doc = new ReportDocument(); doc.Load(AppDomain.CurrentDomain.BaseDirectory + "\\rptQuotation.rpt"); doc.SetDataSource(ds.Tables[0]); // login info SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new Tabl

Remeber page postion on postback



I dont know if this is possible or not...

I want the page when refreshed to remember the position that the user was at on the page, for instance if they are scrolled half way down the page when the page posts back can it return to that position on the page?



Parser Error Message: Could not load type MasterPage File



Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'wamsilverlight.Web.Wam'.

Source Error:

Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Wam.master.cs" Inherits="wamsilverlight.Web.Wam" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Source File: /Wam.Master    Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927


All of the following have been tried over and over again:

1.) Delete all existing .dlls

2.) Delete MasterPage File and recreate it.

3.) Delete MasterPage perform a c

Dynamically load user control without postback


Hi all,

I need urgent help. (c#coding)

In my base page, I have a dropdownlist control which loads different usercontrols on selectedindexchanged event.

While loading these usercontrols, my page postbacks all the page. I used updatepanel but again same problem.

Is there any way to load controls without postback? I Really need help as soon as possible.

Here is my code:

protected void Page_Init(object sender, EventArgs e)
        if (Session["control"] != null)
            string c = Session["control"].ToString();
            if (c == "1")
                iuc = (IlkogretimUC)LoadControl("~/Controls/Ilkogretim.ascx");
                dl.SelectedValue = Session["control"].ToString();
            else if (c == "2")
                luc = (LiseUC)LoadControl("~/Controls/LiseUC.ascx");
                dl.SelectedValue = Session["control"].ToString();
            else if (c == "3")
                youc = (YuksekokulUC)LoadControl("~/Controls/Yuksekokul.ascx");

Setting webpage/masterpage background...image?


I want to have the background of my masterpage (the master page for all of my .aspx pages) have a sort of gradient.  I imagine the only way I can do that is with an image.  Or maybe even some other design, but I want to move away from the "solid color" background.

Is the easiest way to do this just to make an image and set that as the background?  What image size should I make it, because some users could possibly have the normal aspect ratio, or maybe a widescreen?  What should I make it like so that it looks good on all computers?

Thanks in advance. :) 

Checkbox will show panel based on selection without postback.. how to do



I have Two Checkbox in my asp.net textbox..

First what i want is

based on two checkbox user has to be select any one only..

if checkbox1 is selected then Panel1 visible true without postback

if checkbox2 is selected then Panel2 visible true without postback

how can i use stylesheet file on pages that derives from masterpage


Hello. i use masterpage on my project. i want to add stylesheet file on pages that derives from masterpage. I add default.aspx page like this:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<link href="styles/salon.css" rel="s." type="text/css" />

But i can't see design page like this. It gives error like this:
Error 1 Cannot switch views: Validation (Internet Explorer 6): Element 'link' cannot be nested within element 'div'. 

i use IE7. Also how can i use jquery pages that derives from masterpage. Thanks...


Change part of a page without full postback


I have a page with two columns. Initially, the left column will contain a list of links that are article titles. Clicking on one of the links will display the text of the article in the right column, keeping the list of titles in the left column. Clicking on another title will clear the text of the first article and display the second. Is there a way to accomplish this without having to repaint the whole page? I would rather not have the whole page resent each time a title is clicked, but rather have the page stay as is and only the contents of the right column get cleared and redisplayed. I assume there's a way to do this with JavaScript, but I don't know how and would appreciate some help. Thanks!

How to CATCH "Invalid postback or callback argument" exception?



How can I catch this exception? I do not want it to stop my page execution. Can/Should I do that?

Server Error in '/' Application.
Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally

(Imperfect) Solution to TreeView Postback / Client-Side Node Selection Issue


I've seen this question posted on all corners of the web... "How do I disable "AutoPostBack" on the ASP.NET 2.0 TreeView control?!"  Unfortunately, most of the answers either don't work, miss the point (don't work right), or boil down to "You can't do it."  I happen to know that this behavior worked perfectly in the IEWebControls TreeView that Microsoft released as an add-on prior to ASP.NET 2.0, however.  So I set out to find a solution for the ASP.NET 2.0 TreeView issue.

In a nutshell, the behavior that I and others are looking for is to have a TreeView rendered in a page that allows the user to expand, contract, and select nodes within the TreeView without causing a PostBack to the server.  This implies two things: (1) the most recently-selected node should be recorded as the currently-selected node [i.e., at PostBack time, the most-recently selected node is actually represented as the SelectedNode]; and (2) the selected node should exhibit the SelectedNodeStyle as specified in the TreeView declaration.

It appears that the TreeView engineers saw only two possible outcomes from selecting a leaf node in a tree: (1) immediately posting back to the server, or (2) immediately navigating to another web page.  They apparently did not consider option (3) just allowing selection in-place on the client, while waiting for a click on so

get edited value from detailsview


hi sir/madam,

im using asp.net 3.5 sp1 and tried to search the internet but could not find any answer, i have a problem with detailsview as below, when user click on btnEdit, it will call detailsview.changemode(edit) and then allow user to enter data into the textbox, after that user will click on btnsave and then to read the value from txtname and process the value. my question is how do i get the value from txtname? i dont want to use any datasource component and i have tried call the DetailsView1.FindControl("txtname") and it returned txtbox with empty text. hope your can give me some clue where did i missed out.

any helps will be appreciated, thanks.

      <asp:DetailsView ID="DetailsView1" runat="server"  Height="50px" Width="125px" >
<asp:TextBox ID="txtname" runat="server" Text='<%# Bind("name") %>'></asp:TextBox>
<asp:Button ID="btnEdit" runat="server" Text="

GridViewRow change after postback


 I add gridview row dynamically like that; After page postback some gridrow change and not visible. How can solve ? thanks.

protected void grv_RowDataBound(object sender, GridViewRowEventArgs e)
        GridViewRow gvr = e.Row;

        if (gvr.RowType == DataControlRowType.DataRow)
            DataRowView drv = gvr.DataItem as DataRowView;

            string kategoriAd = drv["NAME"].ToString();

            if (!kategoriAd.Equals(m_kategoriAd))
                GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
                TableHeaderCell cell = new TableHeaderCell();
                // TableCell cell = new TableCell();

Detailsview clears filled in fields


I have a details view on my page that has a template field in it. In the template field is a button that when clicked, sets the visible property of another field to true. When this happens the whole detailsview resets and anything that was entered into other fiields is cleared. Is there any way to prevent the other fields from being cleared when the hidden field is set to be shown. 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend