render - When does a page get rendered in ASP.NET? -


I'm writing ASP.NET/C# Project, this is a simple blog page that is with comments. The problem is that when I'm clicking, you can see the comment, loading the original Blogload plus blogs and comments, trying to load the blog / comment, if I try to not load the blog in page_load I have to do it only if postback nothing is displayed. Any help would be appreciated. PS I know that there are many blog engines, but they have specific reasons.

  Protected Zero Page_Init (Object Sender, EventArgs e) {// ParseControls (GlobalVar.pathxsltver); // BindInfo (); } Private Zero ParseControls (string myxlt) {// Load the data file fs = new FileStream (Server.MapPath (GlobalVar.compathver), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); Datasetset = new dataset (); Dset.ReadXml (FS); Fs.Close (); XPathDocument xdoc = New XPathDocument (Server.MapPath (GlobalVar.pathver)); XmlDocument mydoc = New XmlDocument (); XPathNavigator Navigator = xdoc.CreateNavigator (); XPathExpression Expression = Navigator.Compil ("Blog / Blog"); Expression Edsert ("id", XmlSortOrder.Descending, XmlCaseOrder.UpperFirst, string.Empty, XmlDataType.Text); XPathNodeIterator Iterator = Navigator. Selection (expression); Int TheCnt = 0; Int cnt = GlobalVar.BlogCntDisplay; String st = "& lt; blogitem">; Forex Currency (ExpandVigator Item In Iterator) {TheCnt ++; String sid = item.SelectSingleNode ("id"). Values; St = st + "& lt; blog id = \" + + + "+" \ "& gt; + Item Inner xml; St = st + "& lt; ComCnt & gt;" + MyFunc.CountComments (sid, dset) + "& lt; / comCnt> "; If (TheCnt == CNT) {break; }} St = st + "& lt; / blogItems>"; Mydoc.loadXml (cents); XslCompiledTransform transform = new XslCompiledTransform (); XsltSettings Settings = New XsltSettings (True, True); Transform.load (Server.MapPath (myxslt), settings, null); Stringwright SW = new stringwriter (); Change Transf (maedoka, blank, sg); String result = sw.ToString (); // Remove namespace result = result. Change ("xmlns: asp = \" remove \ "", ""); // Pars Control Control ctrl = Page.ParseControl (Results); // event handler // boolean test = blog Find the control to add fund control ("Btn comment 2"). PhBlog.Controls.Add (ctrl); XmlNodeList nList = mydoc.SelectNodes ("// BlogItems / Blog / ID"); Foreach (XmlNode objNode in nml) {button btn comment = (button) phlog.FindControl ("btn comment" + objNode.InnerText); BTN comment. CommonArment = oz. Zod. Intertext; BTN comment. Boardwyth = 0; Comment on BTN. Comand + = new commandAvent handler (button 1_click); }} Secure Zero Page_load (Object Sender, EventAgages E) {// if (! Page. ISPostback) / Parasys Controls (GlobalWire.Pathxsltver);} Parscountols (GlobalWire PathsSolar); } Secure Zero Button 1_Click (Object Sender, CommandEventArgs E) {Label1.Text = "Com Hits:" + e.CommandArgument.ToString (); Parcentrolls (globalwire.blog comments); } 

You have questions that are unclear, but if I understand you correctly, You are thinking that when you want to click the button, then why is the whole page refreshed?

Any time you postback any type, and handle any event in it, the entire page has been re-sung, besides you, Working with the installation. The old one is dead and gone. This is the way that the web works normally

If you only want to reload a part of the page, then you have to use AJAX. In ASP.NET land, this means that an update can be refreshed by placing your comments section inside the panel control.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -