|
Greetings!!!
I have a problem, my web aplication has a Master Page and other page what inherits from the master page. The Master page has a treeview control and a herder. When a choose an option in a node from the treeview it displays the page but the postback appears in the selected page y also in the master page, and then the state of the treeview dissapears.
Waht can i do for avoid the postbak in the master page?
DIEGO
|
|
|
|
|
remove the MyBase.OnLoad from the MasterPages's VB File, if its not being used.
|
|
|
|
|
Ok, it would be a solution, but in the Load event there is the code for loading the treeview, if i use Atlas for ASP.NET ?
Thanks
|
|
|
|
|
I apoligize. I'm not familiar with Atlas for ASP.NET. I'll reasearch my responses better next time.
|
|
|
|
|
Ok, no problem and Thank you for your help.
|
|
|
|
|
Hey AreJay,
Try to implement client callback-enabled type tree view so that you wouldn't need to post back each time you select a node... AND you can find one right out of the box at this website!
http://www.obout.com
-Nila
Nila Fridley
|
|
|
|
|
Rhlye wrote: Waht can i do for avoid the postbak in the master page?
The MasterPage in its nature is a user control which is then combined with the content page to produce the entire web page. So when a postback occurs, the whole web page is reloaded including the contents, header and the treeview control in the masterpage. In this case, if you only want to reload the contents, but the master page part, you may have a couple of options which you can consider:
+ Use frame (or iframe) like you see the online MSDN library web site.
+ Use Atlas (or Ajax in general) to dynamically load the output markup of the content web page only, then attach it to the current document at the client side.
|
|
|
|
|
Hi there
I'm working whit Visual Studio 2005 developing an ASP.NET 2.0 WebPage
I have a DropDownList Control with 2 options to select. I want to generate a validation message according to the selection made in the DropDownList Control. Any ideas???
THANX ¡¡
|
|
|
|
|
Server-side or client-side?
|
|
|
|
|
|
<br />
Sub DropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList.SelectedIndexChanged<br />
Dim script As String = ""<br />
Dim ctrl As DropDownList = CType(sender, DropDownList)<br />
If ctrl.SelectedValue = "something" Then<br />
' Some Kinda Validation occurs<br />
script = "alert('This is what was selected: " & ctrl.SelectedValue & "');"<br />
Else<br />
' Some Kinda Validation occurs<br />
script = "alert('This is what was selected: " & ctrl.SelectedValue & "');"<br />
End If<br />
Me.ClientScript.RegisterClientScriptBlock(Me.GetType, "Alert", script, True)<br />
End Sub<br />
Is this what you had in mind?
|
|
|
|
|
just an fyi- make sure you provide the html control name when incorporating it within the script string... server controls sometimes take a different name once the result page is sent from the server back to the client.
Now, why would anyone be interested in server-side validation? Postbacks are very inefficient! To validate without making round trips to the server, look into using validation controls such as RegularExpression or CompareValidator.
Nila Fridley
|
|
|
|
|
I have created a report generator that creates an XML and passes it back to the browser as an Excel Doc. It works fine but the application lives within https and seems to kill the application with this error:
Microsoft Internet Explorer
Internet Explorer cannot download DataGrid.aspx from www.mysite.com.
Internet Explorer was not able to open Internet site. The requested site is either unavailable or cannot be found. Please try again later. This creates the XML based off user selection etc.....
Report_Gen.aspx
<br />
Dim dataDirPathXML As String = Server.MapPath("..\DataGrids\XML\")<br />
ds.WriteXml(dataDirPathXML & Session.SessionID & ".xml", XmlWriteMode.WriteSchema) <br />
Response.Redirect("..\DataGrids\DataGrid.aspx") <br />
This passes the XML back as Excel.....
DataGrid.aspx
<br />
Dim temp As String = Server.MapPath("XML\") & Session.SessionID & ".xml"<br />
If System.IO.File.Exists(temp) Then<br />
Dim streamReader As New System.IO.StreamReader(temp)<br />
Dim sBuilder As New StringBuilder(streamReader.ReadToEnd)<br />
Dim stringWrite As New System.IO.StringWriter(sBuilder)<br />
Dim htmlWrite As New HtmlTextWriter(stringWrite)<br />
Response.Clear()<br />
Response.AddHeader("content-disposition", "attachment;filename=" & Session.SessionID & ".xls")<br />
Response.Charset = ""<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache)<br />
Response.ContentType = "application/vnd.xls"<br />
Placeholder1.RenderControl(htmlWrite)<br />
Response.Write(stringWrite.ToString())<br />
Response.End()<br />
End If<br />
I've been to the Server.MapPath("..\DataGrids\XML\") location and the xml is not being created.
What am I missing? I've tested this out-side the https and runs fine (local host or Live production server). Please any experiences with this kind of issue would be helpful.
|
|
|
|
|
+ Does the web page DataGrid.aspx support the https?
+ Does it work with the Server.Transfer method instead of the Redirect?
IMO, you don't need to redirect to a seperate web page as it only increases the round trip to the server, meanwhile you can put the code of the DataGrid.aspx in the Report_Gen.aspx which is accessible via https. If you want to reuse this code in multiple places, you simply wrap it up in a custom utility class.
|
|
|
|
|
Not sure what you mean
support the https And I've never used the Server.Transfer method. I'll do some reading on the Transfer to replace the redirect. Thanks!
|
|
|
|
|
Hi.. good day. I have a question, did anyone know how to display the date from database without the time. That's mean i have a textboxt in .aspx page, and i get the data from database n display it in textbox. Normally the date data will come with time. How to remove the time and only display out the date?Can anyone help me to solve the problem? Thanks...
Best Regards,
Pei Sun
|
|
|
|
|
textBox.text = myDate.ToShortDateString();
|
|
|
|
|
Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
Within the SQL you could format it there convert(varchar, dateFieldName, 1)
OR
cDate(dateVariable)
String.Format("0 ", dateVariable) , String.Format("0:mm/dd/yyyy", dateVariable)
Many diffent options.
|
|
|
|
|
Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
I have developed a Web application. There are two web forms in it.
I want these web forms to be deployed in a sub directory of the root
folder, because there are already some files located in the root folder
of the URL. I have created a sub folder in the root folder and copied all
the stuff from the project. When i try to access the specified Aspx file,
Some error occur, like "Configuration Error "
Sayed Muhamad Imran
|
|
|
|
|
|
Hi,
I have an eShop and there is a basket that runs showing the number of products purchased, total, etc. However when I add the the product to the "cart" it doesn't show the right product amount until I do a refresh.
The cart is a List(of Product) stored as a session variable.
I think it has something to do with caching but can't be sure. has anyone else had this problem and how does one fix it?
-- modified at 10:31 Wednesday 19th July, 2006
here is the trace
Begin Load 1.01957399613638 0.000019
BASKET LOADED 1.18213348344552 0.162559 <--- basket loads
aspx.page End Load 1.18221170567768 0.000078
aspx.page Begin ProcessPostData Second Try 1.18223237869618 0.000021
aspx.page End ProcessPostData Second Try 1.18226813743087 0.000036
aspx.page Begin Raise ChangedEvents 1.1822893691796 0.000021
aspx.page End Raise ChangedEvents 1.18230668981672 0.000017
aspx.page Begin Raise PostBackEvent 1.1823231723585 0.000016
WINE ADDED 1.21623949412565 0.033916 <--- wine is added to basket
aspx.page End Raise PostBackEvent
how do I get the event to call before the page load event?
|
|
|
|
|
Looks like you bind data to display before you udpate the cart. If this is the case, you simply refresh the display control by rebinding it to the updated cart.
|
|
|
|
|
no worries, I moved the code from the page_load event to the pre_render event which fired after the cart udate. thnk goodnes for the trace
|
|
|
|