Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[4687] Cross page postbacks in ASP.NET 2.0

Last post 05-15-2008 11:35 PM by madhu521. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [4687] Cross page postbacks in ASP.NET 2.0

    This thread is for discussions of Cross page postbacks in ASP.NET 2.0.

    • Post Points: 30
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 05-26-2005 9:24 AM In reply to

    • Dipti22
    • Not Ranked
    • Joined on 05-17-2005
    • New Member
    • Points 10

    textbox --Gotfocus()

    I am doing my project in ASP.Net . Whenever a page gets loaded i don't want a image control appears beside the textbox . but when the textbox got focus the image control apper beside it . How to do it  as gotfocus() event is not wirking for textbox. Can u give me any sample code.Please help me it's very urgent...



    Thanks & regards
    Dipti
    • Post Points: 10
  • 06-02-2005 6:52 PM In reply to

    • DeKale
    • Not Ranked
    • Joined on 06-02-2005
    • United States
    • New Member
    • Points 10

    More wrong with cross-page postback

    The current implementation of the cross-page postback mechanism is far from ideal. First I was very happy when I noticed this new feature was in ASP.NET 2.0. But now, after some testing I see serious problems using this in my application.

    One serious problem is that when the PreviousPage is build, it uses the QueryString of the CURRENT page. This is a serious issue. (in my application it is). I've posted a Bug report. What I just found out is that (in the beta 2) the Form variables from the posted cross-page can be fetched by the Page.Request.Form  AND the Page.PreviousPage.Request.Form. This seems incorrect. Only Page.Previous.Request.Form should contain these values.
    • Post Points: 10
  • 07-21-2005 5:13 AM In reply to

    creating pdf file from crystal report in asp.net..

    dont start banging ur head if u r getting any error while creating pdf file crystal report.. go thru these steps..

    1) in ur visual studio .net right click on solution expl of ur project and add an .xsd file. this is for creating a new schema that u need for the report,,
    2)in ur schema file that is ur xsd file select what ever database files u want from the server explorer that u find on the right side. this will create a new shema which u can use as a source in ur report..
    3) add a report in to ur porject and then in the database expert .. select more data source..then select ado.net(xml) ,, .. now xml file path will be asked select the xsd file that u just created,, now add the newdataset which just got created to the right list box by clicking on the > button
    4) now from the field explr select the fileds into the report
    5) now time for some coding,,

    if u r writing the code in some button click include this

    private void Button1_Click(object sender, System.EventArgs e)
           {
               
               string tableName = "TEST_HARISH";                                            string rptFile = "PDFTest.rpt";
               string xsdFile = "PDFTest.xsd";
               string pdfFile = "MailPDF.pdf";        
               
               DataTable dat_tblPDF = new DataTable();
               dat_tblPDF = GetTable();
               dat_tblPDF.TableName = tableName;
               DataSet dat_setPDF = new DataSet();
               dat_setPDF.Tables.Add(dat_tblPDF.Copy());
               
               CreateShemaFile(xsdFile, dat_setPDF);
               // Report document
               ReportDocument rpt_docPDF = new ReportDocument();
               string strFileNameRPT = Server.MapPath(rptFile);            
               rpt_docPDF.Load(strFileNameRPT);
               rpt_docPDF.ReportOptions.EnableSaveDataWithReport = false;
               rpt_docPDF.SetDataSource(dat_setPDF);
               

               ExportOptions exp_optPDF = rpt_docPDF.ExportOptions;
               exp_optPDF.ExportFormatType = ExportFormatType.PortableDocFormat;
               exp_optPDF.ExportDestinationType = ExportDestinationType.DiskFile;
               exp_optPDF.DestinationOptions = new DiskFileDestinationOptions();

               DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
               ((DiskFileDestinationOptions)
    // u can give the full path or u can use map path to find the full path
    rpt_docPDF.ExportOptions.DestinationOptions).DiskFileName   =    @"D:\PDF_File\MailPDF.pdf";
               rpt_docPDF.Export();
               mail();
                           
               Response.Write("<a href=\"" +    @"D:\PDF_File\MailPDF.pdf" + "\">" + pdfFile + "</a>");    

           }


    /*now include these function assuming that u r taking the data form a db and then putting it into a xsd and then tranfer to a report then convert it into a pdf format... please change the database name and stuffs like that according to ur project*/


    private DataTable  GetTable()
           {
               DataTable dat_tblPDF = new DataTable("TEST_HARISH");
                                     SqlConnection con = new SqlConnection("Coonection string over here");
               SqlDataAdapter sql_datadpPDF = new SqlDataAdapter("SELECT MAN_NO, PART_NO, NAME FROM TEST_HARISHWITH (NOLOCK)" ,con  ;
               DataSet dat_set = new DataSet();
               sql_datadpPDF.Fill(dat_set, "TEST_HARISH");
               return dat_set.Tables["TEST_HARISH"];

           }
           private void CreateShemaFile(string strFileNameXSD, DataSet dat_setPDF)
           {
               string strServerFilePath  = Server.MapPath(strFileNameXSD);
               FileStream myFileStream = new FileStream (strServerFilePath, FileMode.Create);
               XmlTextWriter myXmlWriter = new XmlTextWriter(myFileStream, Encoding.Unicode);
               dat_setPDF.WriteXml( myXmlWriter, XmlWriteMode.WriteSchema );
               myXmlWriter.Close();
           }


    if u have anymore doubts please be free to mail me ,,, harishjan@india.com
    • Post Points: 0
  • 02-10-2006 7:18 PM In reply to

    Master Page`

    When you have a master page for the source, the target page can't grab the source.  It only gets the source page such as its name but not its controls on the source page.  If you put the <% @PreviousPageType VirtualPath="~/yoursourcefile.aspx" %>, that resolve the issue.  But, that limits on the number of incoming page for target page to one!
    • Post Points: 10
  • 03-08-2007 11:28 AM In reply to

    • Sgro
    • Not Ranked
    • Joined on 03-08-2007
    • New Member
    • Points 5

    Re: Master Page`

    You're totally wrong.

    Let's assume you want to access a HiddenField value on the calling page, and the calling page is, as you said, a content page of a masterpage. You "simply" do it this way:

    string a = ((HiddenField)PreviousPage.Master.FindControl("Form1").FindControl("ContentPlaceHolder1").FindControl("HiddenField1")).Value

    You get empty controls cause you are doing ((HiddenField)PreviousPage.FindControl("HiddenField1")).Value... That obviously can't work, cause you have to begin at the root (PreviousPage.Master) and then follow the control annidation.

    Regards,

    Sgro











    • Post Points: 5
  • 05-15-2008 11:22 PM In reply to

    • madhu521
    • Not Ranked
    • Joined on 05-15-2008
    • India
    • New Member
    • Points 20

    Re: [4687] Cross page postbacks in ASP.NET 2.0

    hsadsadlaskdsad

    • Post Points: 5
  • 05-15-2008 11:26 PM In reply to

    • madhu521
    • Not Ranked
    • Joined on 05-15-2008
    • India
    • New Member
    • Points 20

    Re: textbox --Gotfocus()

    Whenever a page gets loaded i don't want a image control appears beside the textbox . but when the textbox got focus the image control apper beside it . How to do it  as gotfocus() event is not wirking for textbox. Can u give me any sample code.Please help me it's very urgent...

    • Post Points: 5
  • 05-15-2008 11:26 PM In reply to

    • madhu521
    • Not Ranked
    • Joined on 05-15-2008
    • India
    • New Member
    • Points 20

    Re: More wrong with cross-page postback

    dsfsdfdsfdsf

    • Post Points: 5
  • 05-15-2008 11:35 PM In reply to

    • madhu521
    • Not Ranked
    • Joined on 05-15-2008
    • India
    • New Member
    • Points 20

    Re: More wrong with cross-page postback

    adsadasd

    • Post Points: 5
Page 1 of 1 (10 items)