Jump to content
Xtreme .Net Talk

see07

Avatar/Signature
  • Posts

    79
  • Joined

  • Last visited

About see07

  • Birthday 08/26/1954

Personal Information

  • Occupation
    Software Developer
  • Visual Studio .NET Version
    .Net Professional
  • .NET Preferred Language
    C# . net

see07's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I�ve continued working on my code, it�s now thus: public static bool Hay_PostBack(System.Web.UI.Page parent1, string w1, string w1cx, string w1ID, string w2, string w2cx, string w2ID) { WUC_CreDes.WebForm1 frm1; WUC_CreDes.WebForm2 frm2; string fofoi = parent1.GetType().ToString(); if(fofoi == "ASP.WebForm1_aspx") { frm1 = (WUC_CreDes.WebForm1) parent1; frm1.parent1.Example.Controls.Clear(); } } Yet in last line: frm1.parent1.Example.Controls.Clear(); It�s giving me error: WUC_CreDes.WebForm1' doesn�t contains a definition to 'parent1'. Example is a place holder contening both in WebForm1 and in WebForm2. I�ll thank your help. A.L.
  2. I'm coding: public static bool Hay_PostBack(System.Web.UI.Page parent1, string w1, string w1cx, string w1ID, string w2, string w2cx, string w2ID) { string fofoi = parent1.GetType().ToString(); if(fofoi == "ASP.WebForm1_aspx") { WUC_CreDes.WebForm1 frm = (WUC_CreDes.WebForm1) parent1; } else { if(fofoi == "ASP.WebForm2_aspx") { WUC_CreDes.WebForm2 frm = (WUC_CreDes.WebForm2) parent1; } } But frm is not being recogniz by system In what am I wrong???
  3. Hello: From a web form I�m sending to execute a function contained into a class, code in web form is: bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID); In class code is: public static bool Hay_PostBack(WUC_CreDes.WebForm1 parent1, string w1, string w1cx, string w1ID, string w2, string w2cx, string w2ID) { string cual = ""; cual = HttpContext.Current.Session["par1"].ToString(); parent1.Example.Controls.Clear(); if(cual == w1) { Control control = parent1.Page.LoadControl(w1cx); control.ID = w1ID; parent1.Example.Controls.Add(control); } else { Control control = parent1.Page.LoadControl(w2cx); control.ID = w2ID; parent1.Example.Controls.Add(control); } return false; } As you can see, I�m sending to function container into class my WebForm1 to create in function WUC dynamically created. Thinking in a second web form, let us say, WebForm2, if within it I send to execute my function: bool que = WUC_CreDes.Class1.Hay_PostBack(this, w1,w1cx, w1ID, w2, w2cx, w2ID); How can I do to function Hay_PostBack, above mentioned work also for WebForm2 What I need to change because first parameter is WUC_CreDes.Web Form1 parent1? I�ll thank your answers. Greetings. A.L.
  4. Finally I attained it changing de call function thus: bool que = WUC_CreDes.Class1.Hay_PostBack(this.Page as WUC_CreDes.WebForm1); Greetings. A.L.
  5. Finally I attained it thus: In WebForm1 I did: bool que = WUC_CreDes.Class1.Hay_PostBack(this); And in my class I did: public static bool Hay_PostBack(WUC_CreDes.WebForm1 parent1) { parent1.Example.Controls.Clear(); return false; } But now I need do same from a WUC, if I do: bool que = WUC_CreDes.Class1.Hay_PostBack(this); I understand I need replace 'this' with web form's name, here WebForm1.aspx Somebody know how can I do to attain it?
  6. Hello: From a class I want clean a place holder contained in a web form. I�m using this code: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace WUC_CreDes { public class Class1 { public static bool Hay_PostBack() { WUC_CreDes.WebForm1 parent1 = (WUC_CreDes.WebForm1) this.Page; parent1.Example.Controls.Clear(); return false; } } } Where �Example� is my place holder within the web form. When I compile my Project it�s sending me this error: �Keyword �this� is not valid in a static property, a static method or as startup of static field�. Does somebody has some idea about how can I attain it? Thanks you in advance. Greetings. A.L.
  7. Thanks you Robby for your help. Now my project is working fine...
  8. Hello: I have a class where I�m using session variables, notwithstanding when I compile Project it�s sending me this error: �Name �session� doesn�t exist in class or namespace �WUC_CreDes.Class1��. Does it mean that it is not permitted to me using session variables into a class? This is my code: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; namespace WUC_CreDes { public class Class1 { public static bool No_PostBack() { Session["par1"] = ""; return false; } } } Thank you in advance for your help. A.L.
  9. Hello: At last I found a solution. For some reason the page does not create it with the same control Id. the first time as every other time. To solve it I inserted this line: control.ID="WebUserCotrol3"; as it shows: Example.Controls.Clear(); Control control = this.Page.LoadControl("WebUserControl3.ascx"); control.ID="WebUserCotrol3"; Example.Controls.Add(control); I hope this be useful for newbie person as I am. Greetings. A.L.
  10. I have a web form, which has a place holder named Example when, Page_Load happens in my web form. I�m creating dynamically a WUC named WebUserControl3 into my place holder. WebUserControl3 has several text boxes, a button and a label, when user click button I�m executing some calculation which result I�m placing into label. But when user click button occurs Page_Load in web form that contains my place holder and I need recreate my WUC plus data was contained therein, I have tried with ViewState and Session variables but still I can�t pass data from WUC to web form to recreate WUC and its data. Obviously WUC is created again without data. Notwithstanding if I re-enter data in WUC and click button again data are displayed OK. Why first time it isn�t working and begin second try it�s working fine? My code is: private void Page_Load(object sender, System.EventArgs e) { if(!Page.IsPostBack) { } else { Example.Controls.Clear(); Control control = this.Page.LoadControl("WebUserControl3.ascx"); Example.Controls.Add(control); } } Thanks in advance A.L.
  11. It's working through: Examples.HasControls(), or Examples.Controls.Count; thanks you very much.
  12. Hello: In a web form I�m using a place holder, into it, which contains or not a web user control created ado with next code: Example.Controls.C1lear(); Control control = this.Page.LoadControl("WebUserControl3.ascx"); Example.Controls.Add(control); Where Example is my place holder. Is there some way to ask if place holder contains a web user control or if it�s empty? I�ll thank you your help. A.L.
  13. Code I�m using is: Response.ClearContent(); Response.ClearHeaders(); Response.Clear(); Response.ContentType = "application/msword"; Response.Charset = ""; Response.AddHeader("Content-disposition", "inline; filename=ExportPath"); Response.AddHeader("Content-Length", sFileLength); Response.WriteFile(ExportPath); Response.Flush(); Response.Close(); System.IO.File.Delete(ExportPath); If file to display was not MS-Word neither MS-Excel, as a PDF file, then dialog box is not showed. How can I in MS files to such dialog not be showed? A.L.
  14. Hello: Surely I need to be more explicit. I'm trying to export a report from a CrystalReportViewer to a location within client machine, I write it therein and then I want display it imto web page, I want avoid dialgog box asking if user want open or save file. I want that it be displayed into a web form without such a dialog, if instead Word document I export it to .pdf format it is displayed directly without such a dialog. How can I achieve it in Word? A.L.
  15. Hello: I�m sending a Crystal Reports�s report to Word, but a dialog box is opening where user is asking if wish open/save file. I�d like avoid this dialog emerges and report be displayed directly in screen as user would press open button. I�m attaching code I�m using: string ExportPath = sRuta + "CrystalReport1" + ".doc"; crvReportes.ReportSource = cr; CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions(); cr.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile; cr.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows; DiskOpts.DiskFileName = ExportPath; cr.ExportOptions.DestinationOptions = DiskOpts; cr.Export(); Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = "application/msword"; Response.WriteFile(ExportPath); Response.Flush(); Response.Close(); System.IO.File.Delete(ExportPath); Where crvReportes is my CrystalReportViewer y cr is my ReoprtDocument I�ll thank your help. A.L.
×
×
  • Create New...